diff options
author | Guido van Rossum <guido@python.org> | 2001-09-18 03:53:24 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-09-18 03:53:24 +0000 |
commit | f0b35e1501f279aba1b97df068c6bc7384e2ab1a (patch) | |
tree | e1cf13b51b0275e6069e340eeaa02152b0eb5e75 /Python/getcompiler.c | |
parent | bd131497112da319c4361c3e8656b5b7055011e3 (diff) | |
download | cpython-git-f0b35e1501f279aba1b97df068c6bc7384e2ab1a.tar.gz |
Redo the PyMethod attributes using a dir()-friendly approach, creating
descriptors for each attribute. The getattr() implementation is
similar to PyObject_GenericGetAttr(), but delegates to im_self instead
of looking in __dict__; I couldn't do this as a wrapper around
PyObject_GenericGetAttr().
XXX A problem here is that this is a case of *delegation*. dir()
doesn't see exactly the same attributes that are actually defined;
e.g. if the delegate is a Python function object, it supports
attributes like func_code etc., but these are not visible to dir(); on
the other hand, dynamic function attributes (stored in the function's
__dict__) *are* visible to dir(). Maybe we need a mechanism to tell
dir() about the delegation mechanism? I vaguely recall seeing a
request in the newsgroup for a more formal definition of attribute
delegation too. Sigh, time for a new PEP.
Diffstat (limited to 'Python/getcompiler.c')
0 files changed, 0 insertions, 0 deletions