Skip to content
Permalink
Browse files

Fixed input-output of 4th example explanation code (#92)

Ref. example: Deep down, we're all the same
  • Loading branch information...
Vibhu-Agarwal authored and satwikkansal committed Aug 28, 2018
1 parent 2fb0450 commit ac379c9c03c761bb63cc4ed726bf545ff43310ed
Showing with 12 additions and 4 deletions.
  1. +12 −4 README.md
@@ -296,16 +296,24 @@ True
* But why did the `is` operator evaluated to `False`? Let's see with this snippet.
```py
class WTF(object):
def __init__(self): print("I ")
def __del__(self): print("D ")
def __init__(self): print("I")
def __del__(self): print("D")
```
**Output:**
```py
>>> WTF() is WTF()
I I D D
I
I
D
D
False
>>> id(WTF()) == id(WTF())
I D I D
I
D
I
D
True
```
As you may observe, the order in which the objects are destroyed is what made all the difference here.

0 comments on commit ac379c9

Please sign in to comment.
You can’t perform that action at this time.