mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Make Py3.x style "import builtins"
This commit is contained in:
parent
4001847a98
commit
94ca211372
1 changed files with 2 additions and 2 deletions
|
@ -95,8 +95,8 @@ The class can be used to simulate nested scopes and is useful in templating.
|
||||||
|
|
||||||
Example of simulating Python's internal lookup chain::
|
Example of simulating Python's internal lookup chain::
|
||||||
|
|
||||||
import __builtin__
|
import builtins
|
||||||
pylookup = ChainMap(locals(), globals(), vars(__builtin__))
|
pylookup = ChainMap(locals(), globals(), vars(builtins))
|
||||||
|
|
||||||
Example of letting user specified values take precedence over environment
|
Example of letting user specified values take precedence over environment
|
||||||
variables which in turn take precedence over default values::
|
variables which in turn take precedence over default values::
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue