mirror of
https://github.com/satwikkansal/wtfpython
synced 2024-11-22 11:04:25 +01:00
Extend the explanation of the "is not ..." section
I thought that the explanation for "'something' is (not None)" could be a little more explicit.
This commit is contained in:
parent
de113d2491
commit
f20be4cfc4
2
README.md
vendored
2
README.md
vendored
@ -933,7 +933,7 @@ False
|
|||||||
#### 💡 Explanation
|
#### 💡 Explanation
|
||||||
|
|
||||||
- `is not` is a single binary operator, and has behavior different than using `is` and `not` separated.
|
- `is not` is a single binary operator, and has behavior different than using `is` and `not` separated.
|
||||||
- `is not` evaluates to `False` if the variables on either side of the operator point to the same object and `True` otherwise.
|
- `is not` evaluates to `False` if the variables on either side of the operator point to the same object and `True` otherwise. In this expression, `(not None)` evaluates to `True`, since `None` is is `False` in a boolean context, so the expression becomes `'something' is True`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user