[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:
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:

On Sun, Apr 6, 2014 at 1:32 PM, Sebastian Kreft <skreft@gmail.com> wrote:
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:

On 04/06/2014 01:32 PM, Sebastian Kreft wrote:
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:

On Sun, Apr 6, 2014 at 1:32 PM, Sebastian Kreft <skreft@gmail.com> wrote:
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:
participants (4)
-
Brett Cannon
-
Devin Jeanpierre
-
Eric V. Smith
-
Sebastian Kreft