On Fri, 9 Dec 2016 01:51 am, Marco Buttu wrote:
> Sometimes the Python name resolution is explained using a LEGB rule.
> For instance, in [1] (I think also the Learning Python book gives the
> same):
>
> "if a particular name:object mapping cannot be found in the local
> namespaces, the
Chris Angelico wrote:
> On Fri, Dec 9, 2016 at 5:03 AM, Peter Otten <__pete...@web.de> wrote:
>>> The "usual optimization" is exactly what you describe: that different
>>> bytecodes represent Local, Enclosing, and Global/Built-in scope
>>> lookups. (Globals can be created or removed at run-time,
On Fri, Dec 9, 2016 at 5:03 AM, Peter Otten <__pete...@web.de> wrote:
>> The "usual optimization" is exactly what you describe: that different
>> bytecodes represent Local, Enclosing, and Global/Built-in scope
>> lookups. (Globals can be created or removed at run-time, so there's no
>>
Chris Angelico wrote:
> On Fri, Dec 9, 2016 at 1:51 AM, Marco Buttu wrote:
>> "if a particular name:object mapping cannot be found in the local
>> namespaces, the namespaces of the enclosed scope are being searched next.
>> If the search in the enclosed scope is
On Fri, Dec 9, 2016 at 1:51 AM, Marco Buttu wrote:
> "if a particular name:object mapping cannot be found in the local
> namespaces, the namespaces of the enclosed scope are being searched next. If
> the search in the enclosed scope is unsuccessful, too, Python moves on to
Sometimes the Python name resolution is explained using a LEGB rule.
For instance, in [1] (I think also the Learning Python book gives the same):
"if a particular name:object mapping cannot be found in the local
namespaces, the namespaces of the enclosed scope are being searched
next. If the