Nick Coghlan added the comment: Part of the issue 19030 patch was incorrect and we missed it in the review. Specifically, the else clause in this bit:
try: get_obj = getattr(cls, name) except Exception as exc: pass else: homecls = getattr(get_obj, "__class__") homecls = getattr(get_obj, "__objclass__", homecls) if homecls not in possible_bases: # if the resulting object does not live somewhere in the # mro, drop it and go with the dict_obj version only homecls = None get_obj = sentinel The restriction that the __class__ of the object returned by a descriptor must appear in the MRO doesn't make any sense. The entire else block should be simplified to just: homecls = getattr(get_obj, "__objclass__", None) And a "defining class" of None should be documented as a possible result for dynamic attributes that appear in __dir__ but don't set __objclass__ appropriately, and don't correspond to a descriptor. ---------- nosy: +ncoghlan _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16938> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com