Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,16 @@ 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", end = " ")
def __del__(self): print("D", end = " ")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, end = " " is python 3 specific. That's why I omitted it initially πŸ˜…

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the output which we should change IMO to avoid breaking this on Python 2.x

Copy link
Contributor Author

@Vibhu-Agarwal Vibhu-Agarwal Aug 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, then the output can be shown as

I
D
I
D
True

```

**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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out and fixing it :)

```
As you may observe, the order in which the objects are destroyed is what made all the difference here.

Expand Down