[Python-Dev] Rejecting PEP 473: Adding structured data to built-in exceptions

Victor Stinner vstinner at redhat.com
Sat Mar 16 06:06:23 EDT 2019


Hi,

While I would like to get such new attributes, I see drawbacks as blocker
issues and so I am fine with this PEP rejection. Performance is too
critical for most common exceptions.

For me one blocker issue is the high risk of creating reference cycles. And
the weak reference API isn't the most practical :-(

Moreover I expect slowdown, whereas exceptions are already expensive :-(
Recently, internal code to get an attribute has been reworked to avoid
exception whenever possible, and it made the code faster.

Victor

Le vendredi 15 mars 2019, Brett Cannon <brett at python.org> a écrit :
> The steering council felt the PEP was too broad and not focused enough.
Discussions about adding more attributes to built-in exceptions can
continue on the issue tracker on a per-exception basis (and obviously here
for any broader points, e.g. performance implications as I know that has
come up before when the idea of storing relevant objects on exceptions).
> Thanks to Sebastian Kreft for taking the time to write the PEP in the
first place.
>

-- 
Night gathers, and now my watch begins. It shall not end until my death.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190316/7b0e0a07/attachment.html>


More information about the Python-Dev mailing list