[issue11133] inspect.getattr_static code execution

Florian Mayer report at bugs.python.org
Sun Feb 20 13:48:25 CET 2011


Florian Mayer <flormayer at aim.com> added the comment:

Apparently another way to get getattr_static to execute code in Python 2.3rc3 is simply the following.

>>> class Foo:
...     @property
...     def __dict__(self):
...         print("Hello, World.")
...         return {}
... 
>>> import inspect
>>> inspect.getattr_static(Foo(), 'a')
Hello, World.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/name/opt/lib/python3.2/inspect.py", line 1130, in getattr_static
    raise AttributeError(attr)
AttributeError: a
>>>

----------
nosy: +segfaulthunter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11133>
_______________________________________


More information about the Python-bugs-list mailing list