diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-18 18:40:46 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-18 18:40:46 (GMT) |
commit | 04c420f605b2bb7902f1afc3d62a45fbb0295bd0 (patch) | |
tree | 1f020f11a29cf7646f22275583fb6a9be1a8925c /Doc/reference | |
parent | 679db4aa99352abc3c9d93dcfc30e772760a43da (diff) | |
download | cpython-04c420f605b2bb7902f1afc3d62a45fbb0295bd0.zip cpython-04c420f605b2bb7902f1afc3d62a45fbb0295bd0.tar.gz cpython-04c420f605b2bb7902f1afc3d62a45fbb0295bd0.tar.bz2 |
Merged revisions 60043-60052 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r60043 | christian.heimes | 2008-01-18 10:51:43 +0100 (Fri, 18 Jan 2008) | 2 lines
Build _ctypes after the other extensions. Its build process depends
on the _weakref extension (and maybe other modules, too)
........
r60048 | christian.heimes | 2008-01-18 12:58:50 +0100 (Fri, 18 Jan 2008) | 2 lines
Added win_add2path.py to Tools/scripts/
Added builddoc.bat to Doc/
........
r60049 | vinay.sajip | 2008-01-18 16:54:14 +0100 (Fri, 18 Jan 2008) | 1 line
Added section on passing contextual information to logging and documentation for the LoggerAdapter class.
........
r60050 | vinay.sajip | 2008-01-18 16:55:57 +0100 (Fri, 18 Jan 2008) | 1 line
Added LoggerAdapter class, changed copyright dates, made check for extra parameter passed to logging methods explicitly against None rather than a truth value.
........
r60051 | georg.brandl | 2008-01-18 17:42:57 +0100 (Fri, 18 Jan 2008) | 2 lines
Note that genexps are function scopes too and therefore won't see class attributes.
........
r60052 | christian.heimes | 2008-01-18 19:24:07 +0100 (Fri, 18 Jan 2008) | 1 line
Added bytes and b'' as aliases for str and ''
........
Diffstat (limited to 'Doc/reference')
-rw-r--r-- | Doc/reference/executionmodel.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/reference/executionmodel.rst b/Doc/reference/executionmodel.rst index 1f85e49..43515d9 100644 --- a/Doc/reference/executionmodel.rst +++ b/Doc/reference/executionmodel.rst @@ -50,7 +50,13 @@ variable is defined in a block, its scope includes that block. If the definition occurs in a function block, the scope extends to any blocks contained within the defining one, unless a contained block introduces a different binding for the name. The scope of names defined in a class block is limited to the -class block; it does not extend to the code blocks of methods. +class block; it does not extend to the code blocks of methods -- this includes +generator expressions since they are implemented using a function scope. This +means that the following will fail:: + + class A: + a = 42 + b = list(a + i for i in range(10)) .. index:: single: environment |