mirror of
https://github.com/satwikkansal/wtfpython.git
synced 2024-08-17 16:10:42 +03:00
Update README.md
Grammatical fix
This commit is contained in:
parent
fe9ed47217
commit
be377779b6
2
README.md
vendored
2
README.md
vendored
@ -619,7 +619,7 @@ True
|
||||
* When `id` was called, Python created a `WTF` class object and passed it to the `id` function. The `id` function takes its `id` (its memory location), and throws away the object. The object is destroyed.
|
||||
* When we do this twice in succession, Python allocates the same memory location to this second object as well. Since (in CPython) `id` uses the memory location as the object id, the id of the two objects is the same.
|
||||
* So, the object's id is unique only for the lifetime of the object. After the object is destroyed, or before it is created, something else can have the same id.
|
||||
* But why did the `is` operator evaluated to `False`? Let's see with this snippet.
|
||||
* But why did the `is` operator evaluate to `False`? Let's see with this snippet.
|
||||
```py
|
||||
class WTF(object):
|
||||
def __init__(self): print("I")
|
||||
|
Loading…
Reference in New Issue
Block a user