Skip to content

Commit ac379c9

Browse files
Vibhu-Agarwalsatwikkansal
authored andcommitted
Fixed input-output of 4th example explanation code (satwikkansal#92)
Ref. example: Deep down, we're all the same
1 parent 2fb0450 commit ac379c9

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,24 @@ True
296296
* But why did the `is` operator evaluated to `False`? Let's see with this snippet.
297297
```py
298298
class WTF(object):
299-
def __init__(self): print("I ")
300-
def __del__(self): print("D ")
299+
def __init__(self): print("I")
300+
def __del__(self): print("D")
301301
```
302302
303303
**Output:**
304304
```py
305305
>>> WTF() is WTF()
306-
I I D D
306+
I
307+
I
308+
D
309+
D
310+
False
307311
>>> id(WTF()) == id(WTF())
308-
I D I D
312+
I
313+
D
314+
I
315+
D
316+
True
309317
```
310318
As you may observe, the order in which the objects are destroyed is what made all the difference here.
311319

0 commit comments

Comments
 (0)