Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> C() and True
- __bool__
- <__main__.C at 0x7fd5502c89d0> # These addresses change with repeated execution.
- -------------------
- >>> c = C()
- >>> c and True
- __bool__
- <__main__.C at 0x7fd5502c89d0>
- >>> c and True
- __bool__
- True
- >>> # That cycles on and on...
- -------------------
- >>> q = C() and True
- >>> if q:
- ... print('if stmt')
- __bool__
- __bool__
- if stmt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement