summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-15 22:03:32 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-15 22:03:32 (GMT)
commit687ae00460da9cac04eb1ba8f6f5ab4db25fbfc2 (patch)
tree24a57c48ce1aa06744efacd21d635c581ef549fd /Lib
parent6642653875ff1b2f4bbe9c351c58cfa1c1abbede (diff)
downloadcpython-687ae00460da9cac04eb1ba8f6f5ab4db25fbfc2.zip
cpython-687ae00460da9cac04eb1ba8f6f5ab4db25fbfc2.tar.gz
cpython-687ae00460da9cac04eb1ba8f6f5ab4db25fbfc2.tar.bz2
Get rid of __defined__ and tp_defined -- there's no need to
distinguish __dict__ and __defined__ any more. In the C structure, tp_cache takes its place -- but this hasn't been implemented yet.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/inspect.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index c5c6709..e55edca 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -200,24 +200,9 @@ def classify_class_attrs(cls):
obj = getattr(cls, name)
# Figure out where it was defined.
- # A complication: static classes in 2.2 copy dict entries from
- # bases into derived classes, so it's not enough just to look for
- # "the first" class with the name in its dict. OTOH:
- # 1. Some-- but not all --methods in 2.2 come with an __objclass__
- # attr that answers the question directly.
- # 2. Some-- but not all --classes in 2.2 have a __defined__ dict
- # saying which names were defined by the class.
homecls = getattr(obj, "__objclass__", None)
if homecls is None:
- # Try __defined__.
- for base in mro:
- if hasattr(base, "__defined__"):
- if name in base.__defined__:
- homecls = base
- break
- if homecls is None:
- # Last chance (and first chance for classic classes): search
- # the dicts.
+ # search the dicts.
for base in mro:
if name in base.__dict__:
homecls = base