[New-bugs-announce] [issue31465] Allow _PyType_Lookup() to raise exceptions

Stefan Behnel report at bugs.python.org
Thu Sep 14 04:07:19 EDT 2017


New submission from Stefan Behnel:

Follow-up to issue 31336:
The fact that _PyType_Lookup() does not propagate exceptions leaves some space for ambiguity. If, in a chain of MRO lookups, one would fail and a later one would succeed, is it correct to keep trying? What if the first failure actually failed to see an otherwise existing attribute in that class? We simply can't know because the lookup failed for *some* reason.

I think, the only way to really avoid that ambiguity would be to allow _PyType_Lookup() to raise exceptions, and to make it fail on the first error.

----------
components: Interpreter Core
messages: 302156
nosy: scoder
priority: normal
severity: normal
status: open
title: Allow _PyType_Lookup() to raise exceptions
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31465>
_______________________________________


More information about the New-bugs-announce mailing list