This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients barry, eli.bendersky, ethan.furman, ncoghlan, pitrou, r.david.murray
Date 2013-09-16.06:18:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379312285.58.0.432855914943.issue19030@psf.upfronthosting.co.za>
In-reply-to
Content
types is the OO equivalent to functools these days, in addition to its original role of exposing the internal type objects that aren't builtins.

However, it seems to me that the fix for issue 1785 is simply *wrong*: it eliminated the exceptions at the expense of sometimes returning the *wrong answer*. The change in that issue means the inspect module isn't implementing the descriptor protocol correctly, and thus may provide a raw descriptor object when attempting to retrieve that attribute will return something else.

Instead of the current behaviour, the inspect module should be trying getattr *first*, and only falling back to peeking in the __dict__ directly if that throws an exception.
History
Date User Action Args
2013-09-16 06:18:05ncoghlansetrecipients: + ncoghlan, barry, pitrou, r.david.murray, eli.bendersky, ethan.furman
2013-09-16 06:18:05ncoghlansetmessageid: <1379312285.58.0.432855914943.issue19030@psf.upfronthosting.co.za>
2013-09-16 06:18:05ncoghlanlinkissue19030 messages
2013-09-16 06:18:05ncoghlancreate