Skip to content

Commit 38b2bf6

Browse files
暮晨leisurelicht
暮晨
authored andcommitted
EX.Name resolution ignoring class scope
1 parent 3f6f413 commit 38b2bf6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ So, here we go...
6464
- [> Same operands, different story!/同人不同命!](#-same-operands-different-story同人不同命)
6565
- [> The out of scope variable/外部作用域变量](#-the-out-of-scope-variable外部作用域变量)
6666
- [> Be careful with chained operations/小心链式操作](#-be-careful-with-chained-operations小心链式操作)
67-
- [> Name resolution ignoring class scope](#-name-resolution-ignoring-class-scope)
67+
- [> Name resolution ignoring class scope/忽略类作用域的名称解析](#-name-resolution-ignoring-class-scope忽略类作用域的名称解析)
6868
- [> Needle in a Haystack](#-needle-in-a-haystack)
6969
- [Section: The Hidden treasures!](#section-the-hidden-treasures)
7070
- [> Okay Python, Can you make me fly? *](#-okay-python-can-you-make-me-fly-)
@@ -1806,7 +1806,7 @@ False
18061806
18071807
---
18081808
1809-
### > Name resolution ignoring class scope
1809+
### > Name resolution ignoring class scope/忽略类作用域的名称解析
18101810
18111811
1\.
18121812
```py
@@ -1842,10 +1842,10 @@ class SomeClass:
18421842
5
18431843
```
18441844
1845-
#### 💡 Explanation
1846-
- Scopes nested inside class definition ignore names bound at the class level.
1847-
- A generator expression has its own scope.
1848-
- Starting from Python 3.X, list comprehensions also have their own scope.
1845+
#### 💡 说明:
1846+
- 类定义中嵌套的作用域会忽略类内的名称绑定.
1847+
- 生成器表达式有它自己的作用域.
1848+
- Python 3.X 开始, 列表推导式也有自己的作用域.
18491849
18501850
---
18511851

0 commit comments

Comments
 (0)