[issue26389] Expand traceback module API to accept just an exception as an argument

2021-02-12 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.10 -Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26389] Expand traceback module API to accept just an exception as an argument

2020-11-05 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26389] Expand traceback module API to accept just an exception as an argument

2020-11-05 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 91e93794d5dd1aa91fbe142099c2955e0c4c1660 by Zackery Spytz in branch 'master': bpo-26389: Allow passing an exception object in the traceback module (GH-22610)

[issue26389] Expand traceback module API to accept just an exception as an argument

2020-10-08 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 6.0 -> 7.0 pull_requests: +21593 pull_request: https://github.com/python/cpython/pull/22610 ___ Python tracker

[issue26389] Expand traceback module API to accept just an exception as an argument

2019-11-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be nice to see this one come to fruition. -- nosy: +rhettinger ___ Python tracker ___

[issue26389] Expand traceback module API to accept just an exception as an argument

2019-11-13 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: > were you interested in continuing with Brett's (and your) suggestion for the > API by making the first argument positional-only and the others optional? Yes, but I currently do not have the time; if someone else want to take over; or if you need to

[issue26389] Expand traceback module API to accept just an exception as an argument

2019-10-20 Thread Cheryl Sabella
Cheryl Sabella added the comment: @mbussonn, were you interested in continuing with Brett's (and your) suggestion for the API by making the first argument positional-only and the others optional? -- versions: +Python 3.9 -Python 3.8 ___ Python

[issue26389] Expand traceback module API to accept just an exception as an argument

2019-04-10 Thread Brett Cannon
Brett Cannon added the comment: Boy, having a postional-only parameter in that first position would have been handy when we created this API (as Matthias pointed out). :) The 'exec' keyword-only parameter is obviously the safest option here. Making the first parameter positional-only and

[issue26389] Expand traceback module API to accept just an exception as an argument

2019-04-08 Thread Cheryl Sabella
Cheryl Sabella added the comment: The last comment on the original PR for this issue was to wait until an API was decided upon before proceeding with creating a new PR. Bumping this issue to generate new discussion and hopefully reach concession on an API. -- nosy: +cheryl.sabella

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-03-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Matthias, I will try to respond tomorrow. -- ___ Python tracker ___ ___

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-03-02 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: > (Optional) Change 'value' to 'exc' in the API to reflect the 3.x restriction > Keep the synonym until after 2.7. Do you mean after 2.7 EOL, or after 3.7 ? > etype: In 3.5+ document that it is an ignored dummy argument and that one can > just pass 0,

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Comments probably apply to format_exception and in part, format_exception_only (both also patched in PR237) but I have not checked behavior or code at all. -- ___ Python tracker

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: The print_exception API goes back to when exception values were (or at least, could be) strings. Its doc is incomplete as to the requirements on the args and, at least by 3.5, erroneous. To modify it, we need to understand how it actually works now. In

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-27 Thread Brett Cannon
Brett Cannon added the comment: I don't think supporting both approaches is worth it; we should just choose one of them. As for which one, I'm torn. The single argument one is the most pragmatic, but changing types like has always bugged me. But as Martin points out, the `raise` syntax

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-27 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: > Another point is that it may be better to keep the existing parameter name > “value”, rather than (eventually?) replacing it with “exc”. I think both of > these things could be accomplished by juggling the “value” and “etype” > parameters: I agreed,

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Martin Panter
Martin Panter added the comment: Matthias’s proposal adds support for a new keyword-only “exc” argument: print_exception(exc=exception_instance) I still think it is worth supporting a single positional argument as well: print_exception(exception_instance) Another point is that it may

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: I've attempted a Pull-request trying to implement what Brett is describing. See https://github.com/python/cpython/pull/327, and opened http://bugs.python.org/issue29660 to document that etype is ignored and decide wether it should emit DeprecationWarning

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Matthias Bussonnier
Changes by Matthias Bussonnier : -- pull_requests: +287 ___ Python tracker ___

[issue26389] Expand traceback module API to accept just an exception as an argument

2017-02-26 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: Just came across that with wanting to use print_exception and got the same idea. It seem like in print_exception, and format_exception, etype is already ignored and `type(value)` is used, so I think we could also "just" also ignore tb (unless set) and

[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-20 Thread Brett Cannon
Brett Cannon added the comment: So Terry's right that in my haste to write down the idea I contradicted myself. I do want to tweak the APIs in the traceback module to accept only an exception. The question is whether we need entirely new functions or if the pre-existing ones can be updated to

[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-19 Thread Martin Panter
Martin Panter added the comment: There is precedent with Python 2’s “raise” statement for accepting an exception instance for the first parameter (where an exception class would otherwise be passed). Also, generator.throw() supports this; see Issue 14911 for clarifying its documentation. I

[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: You title and post don't seem to match. The title says to expand the API and the post says there is no reason to expand the API. Did you mean 'good reason'? Also, I think you meant 'grab the traceback' (from the exception) rather than 'grab the exception'.

[issue26389] Expand traceback module API to accept just an exception as an argument

2016-02-18 Thread Brett Cannon
New submission from Brett Cannon: When reading https://docs.python.org/3/library/traceback.html#traceback.print_exception I noticed that everything takes a traceback or a set of exception type, instance, and traceback. But since Python 3.0 all of that information is contained in a single