Skip to content

Commit 0ef7690

Browse files
暮晨ducheng
暮晨
authored and
ducheng
committed
EX.Name resolution ignoring class scope
1 parent f610d18 commit 0ef7690

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-)
@@ -1801,7 +1801,7 @@ False
18011801
18021802
---
18031803
1804-
### > Name resolution ignoring class scope
1804+
### > Name resolution ignoring class scope/忽略类作用域的名称解析
18051805
18061806
1\.
18071807
```py
@@ -1837,10 +1837,10 @@ class SomeClass:
18371837
5
18381838
```
18391839
1840-
#### 💡 Explanation
1841-
- Scopes nested inside class definition ignore names bound at the class level.
1842-
- A generator expression has its own scope.
1843-
- Starting from Python 3.X, list comprehensions also have their own scope.
1840+
#### 💡 说明:
1841+
- 类定义中嵌套的作用域会忽略类内的名称绑定.
1842+
- 生成器表达式有它自己的作用域.
1843+
- Python 3.X 开始, 列表推导式也有自己的作用域.
18441844
18451845
---
18461846

0 commit comments

Comments
 (0)