[issue46328] add sys.exception()

2022-01-13 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46328] add sys.exception()

2022-01-13 Thread Irit Katriel
Irit Katriel added the comment: New changeset c590b581bba517f81ced2e6f531ccc9e2e22eab5 by Irit Katriel in branch 'main': bpo-46328: Add sys.exception() (GH-30514) https://github.com/python/cpython/commit/c590b581bba517f81ced2e6f531ccc9e2e22eab5 --

[issue46328] add sys.exception()

2022-01-10 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +AlexWaygood ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
Irit Katriel added the comment: Cool. I just removed the do-not-merge label from the PR and I guess it's ready to be reviewed. -- ___ Python tracker ___

[issue46328] add sys.exception()

2022-01-10 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: sys.exception() seems like a decent enough trade-off. I've always disliked the abbreviations in "exc_info". It doesn't feel big enough for a PEP to me. -- ___ Python tracker

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
Irit Katriel added the comment: I thought of something like sys.active_exception() but it seems like a lot to type. sys.exception() was suggested in pep3134. Does this change need a pep? -- ___ Python tracker

[issue46328] add sys.exception()

2022-01-10 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46328] add sys.exception()

2022-01-10 Thread Eric Snow
Eric Snow added the comment: FWIW, here's an alternative we should *not* pursue: return just the exception from sys.exc_info(). For compatibility, we would implement `__iter__` and `__getitem__` on BaseException, to duplicate the behavior of the current tuple. There are a number of good

[issue46328] add sys.exception()

2022-01-10 Thread Eric Snow
Eric Snow added the comment: So sys.exception() will be equivalent to sys.exc_info()[1] (or rather, sys.exc_info() will be (type(sys.exception()), sys.exception(), sys.exception().__traceback__))? That seems good to me. -- nosy: +eric.snow ___

[issue46328] add sys.exception()

2022-01-10 Thread Dennis Sweeney
Dennis Sweeney added the comment: Would there be any value in spelling this as sys.active_exception() or sys.current_exception() or sys.get_exception() or sys.exception_in_flight() or similar? My only worry is confusion between sys.exception() versus builtins.Exception. -- nosy:

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
Change by Irit Katriel : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
Irit Katriel added the comment: This is part of a larger plan to reduce the footprint of the exc_info triplet on the language. See https://gist.github.com/iritkatriel/3927147548b10a7929cb0b680e3adc52 History -- ___ Python tracker

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
Change by Irit Katriel : -- Removed message: https://bugs.python.org/msg410215 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
Irit Katriel added the comment: This is part of a larger plan to reduce the footprint of the exc_info footprint on the language. See https://gist.github.com/iritkatriel/3927147548b10a7929cb0b680e3adc52 -- ___ Python tracker

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +28717 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30514 ___ Python tracker ___

[issue46328] add sys.exception()

2022-01-10 Thread Irit Katriel
New submission from Irit Katriel : Following to changes in issue45711, the interpreter's internal representation of the active exception is just the exception instance (the exc_type and exc_traceback fields were removed). For backwards compatibility, sys.exc_info() constructs the (typ, val,