Message197871
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. |
|
Date |
User |
Action |
Args |
2013-09-16 06:18:05 | ncoghlan | set | recipients:
+ ncoghlan, barry, pitrou, r.david.murray, eli.bendersky, ethan.furman |
2013-09-16 06:18:05 | ncoghlan | set | messageid: <1379312285.58.0.432855914943.issue19030@psf.upfronthosting.co.za> |
2013-09-16 06:18:05 | ncoghlan | link | issue19030 messages |
2013-09-16 06:18:05 | ncoghlan | create | |
|