[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2021-12-18 Thread Ryan Fox
Ryan Fox added the comment: If you change the class member 'x' to a different name like 'y', then cv doesn't include 'x', but does include an unbound 'y'. In both cases, the function isn't referring to a global variable, just the class member of that name. Besides the function itself, no

[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2021-12-18 Thread hongweipeng
hongweipeng added the comment: Why is expected that 'x' would not exist in cv.globals? I think it works normally, you can see `x` in `func.__globals__`. -- nosy: +hongweipeng ___ Python tracker

[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2021-11-26 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11. -- nosy: +iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2021-11-26 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.5, Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2016-03-19 Thread Ryan Fox
New submission from Ryan Fox: If a variable 'x' exists in the global or local scope, and a function (also defined in the same scope as 'x', or lower) refers only to a member named 'x' of an object, inspect.getclosurevars will include a reference to the variable, rather than the member. Okay,

[issue26577] inspect.getclosurevars returns incorrect variable when using class member with the same name as other variable

2016-03-19 Thread SilentGhost
Changes by SilentGhost : -- nosy: +yselivanov type: -> behavior versions: -Python 3.3, Python 3.4 ___ Python tracker ___