[RFC] Draft-PEP: Adding structured data to built-in exceptions
Continuing the discussion started in https://mail.python.org/pipermail/python-ideas/2014-February/025601.html, attached is a draft PEP explaining the rationale of the idea and the required changes. I'm looking forward to your comments. -- Sebastian Kreft
On 04/06/2014 01:32 PM, Sebastian Kreft wrote:
Continuing the discussion started in https://mail.python.org/pipermail/python-ideas/2014-February/025601.html, attached is a draft PEP explaining the rationale of the idea and the required changes.
I'm looking forward to your comments.
I'm generally in favor. My only concern would be object lifetimes if you're holding references to actual objects. For motivating use cases, one might be the difficulty in a string parser getting this correct:
{}["fo\"\\'\""] Traceback (most recent call last): File "<stdin>", line 1, in <module> KeyError: 'fo"\\\'"'
On Sun, Apr 6, 2014 at 1:32 PM, Sebastian Kreft <skreft@gmail.com> wrote:
Continuing the discussion started in https://mail.python.org/pipermail/python-ideas/2014-February/025601.html, attached is a draft PEP explaining the rationale of the idea and the required changes.
I'm looking forward to your comments.
I currently don't have time to read the PEP, but I didn't notice references to bugs I previously on this exact topic: http://bugs.python.org/issue18162 http://bugs.python.org/issue18156 http://bugs.python.org/issue18166 http://bugs.python.org/issue18165 http://bugs.python.org/issue18163
I think you need to make clear when exceptions will have these attributes. Is it always, whenever the exception is raised by Python itself or anything in the Python standard library, and otherwise depends on the raiser? P.S. +1 because https://mail.python.org/pipermail/python-ideas/2013-April/020308.html ;) -- Devin On Sun, Apr 6, 2014 at 10:32 AM, Sebastian Kreft <skreft@gmail.com> wrote:
Continuing the discussion started in https://mail.python.org/pipermail/python-ideas/2014-February/025601.html, attached is a draft PEP explaining the rationale of the idea and the required changes.
I'm looking forward to your comments.
-- Sebastian Kreft
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
participants (4)
-
Brett Cannon
-
Devin Jeanpierre
-
Eric V. Smith
-
Sebastian Kreft