Rouslan Korneychuk wrote:
I found the answer in Python's source code. When you execute a code
object, PyFrame_New is called which gets 'bultins' from 'globals', but
inside PyFrame_New (defined on line 596 of Objects/frameobject.c) is the
following (line 613):
builtins =
On 01/19/2013 09:59 PM, Steven D'Aprano wrote:
I've been playing around with ChainedMap in Python 3.3, and run into
something which perplexes me. Let's start with an ordinary function that
accesses one global and one builtin.
x = 42
def f():
print(x)
If you call f(), it works as
I've been playing around with ChainedMap in Python 3.3, and run into
something which perplexes me. Let's start with an ordinary function that
accesses one global and one builtin.
x = 42
def f():
print(x)
If you call f(), it works as expected. But let's make a version with no
access to