Skip to content

Commit baa1ad6

Browse files
author
暮晨
committed
EX.When True is actually False
1 parent 9a21b26 commit baa1ad6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ So, here we go...
4545
- [> yielding None/生成 None](#-yielding-none生成-none)
4646
- [> Mutating the immutable!/强人所难](#-mutating-the-immutable强人所难)
4747
- [> The disappearing variable from outer scope/消失的外部变量](#-the-disappearing-variable-from-outer-scope消失的外部变量)
48-
- [> When True is actually False](#-when-true-is-actually-false)
48+
- [> When True is actually False/真亦假](#-when-true-is-actually-false真亦假)
4949
- [> From filled to None in one instruction...](#-from-filled-to-none-in-one-instruction)
5050
- [> Subclass relationships *](#-subclass-relationships-)
5151
- [> The mysterious key type conversion *](#-the-mysterious-key-type-conversion-)
@@ -1043,7 +1043,7 @@ NameError: name 'e' is not defined
10431043
10441044
---
10451045
1046-
### > When True is actually False
1046+
### > When True is actually False/真亦假
10471047
10481048
```py
10491049
True = False
@@ -1056,10 +1056,10 @@ if True == False:
10561056
I've lost faith in truth!
10571057
```
10581058
1059-
#### 💡 Explanation:
1059+
#### 💡 说明:
10601060
1061-
- Initially, Python used to have no `bool` type (people used 0 for false and non-zero value like 1 for true). Then they added `True`, `False`, and a `bool` type, but, for backward compatibility, they couldn't make `True` and `False` constants- they just were built-in variables.
1062-
- Python 3 was backward-incompatible, so it was now finally possible to fix that, and so this example won't work with Python 3.x!
1061+
- 最初, Python 并没有 `bool` 型 (人们用0表示假值, 用非零值比如1作为真值). 后来他们添加了 `True`, `False`, `bool` 型, 但是, 为了向后兼容, 他们没法把 `True` `False` 设置为常量, 只是设置成了内置变量.
1062+
- Python 3 由于不再需要向后兼容, 终于可以修复这个问题了, 所以这个例子无法在 Python 3.x 中执行!
10631063
10641064
---
10651065

0 commit comments

Comments
 (0)