[Python-Dev] Re: Critique of PEP 657

2021-06-30 Thread Terry Reedy
On 6/30/2021 5:30 PM, Pablo Galindo Salgado wrote: Also, notice we are extending the traceback module (in Python) to support this, so you probably can also leverage those changes so you don't need to mess with code objects yourself :) IDLE currently uses traceback.extract_tb and traceback.prin

[Python-Dev] Re: Critique of PEP 657

2021-06-30 Thread Terry Reedy
> Then how will modules that customizes traceback presentation, such as idlelib, be able to get the 4-tuple for a particular traceback entry? From the exception, you can get the code object and from the code object the extra information using the Python API: Example: >>> try: ...   1/0 ...

[Python-Dev] Re: Critique of PEP 657

2021-06-30 Thread Pablo Galindo Salgado
Also, notice we are extending the traceback module (in Python) to support this, so you probably can also leverage those changes so you don't need to mess with code objects yourself :) On Wed, 30 Jun 2021 at 22:29, Pablo Galindo Salgado wrote: > Hi Terry, > > Thanks for your message! > > > Then h

[Python-Dev] Re: Critique of PEP 657

2021-06-30 Thread Pablo Galindo Salgado
Hi Terry, Thanks for your message! > Then how will modules that customizes traceback presentation, such as idlelib, be able to get the 4-tuple for a particular traceback entry? >From the exception, you can get the code object and from the code object the extra information using the Python API:

[Python-Dev] Re: Critique of PEP 657

2021-06-30 Thread Terry Reedy
On 6/30/2021 12:30 PM, Ammar Askar wrote: I don't think we're making strong claims that the full `(line, end_line, column, end_column)` should be the canonical representation for exception locations. The only concrete place we suggest their usage is in the printing of tracebacks. sys.__excepth

[Python-Dev] Re: Critique of PEP 657

2021-06-30 Thread Ammar Askar
Hi Mark, Thank you for the feedback. Let me address/elaborate some of the points that Pablo touched on. > PEP 657 proposes that locations for exceptions be treated as ranges, > whereas tracing, profiling and debugging currently treat locations as > points. I don't think we're making strong claim

[Python-Dev] Re: Critique of PEP 657

2021-06-30 Thread Pablo Galindo Salgado
Hello Mark, Thanks for writing this email. I do appreciate your effort and your passion for trying to improve Python and this work, but I have to say that I am a bit frustrated with how are you dealing with this and that unfortunately, I have to admit that this is absorbing too much emotional ener

[Python-Dev] Re: Enum -- last call for comments on 3.10 changes

2021-06-30 Thread Nick Coghlan
On Tue, 29 Jun 2021, 12:45 am Ethan Furman, wrote: > On 6/28/21 6:54 AM, Nick Coghlan wrote: > > > * Enum repr() changing back to the historical behaviour, unless you opt > in to the > > new behaviour with the global enum decorator: definite +1 here > > Question for Nick: this behavior is cur

[Python-Dev] Critique of PEP 657

2021-06-30 Thread Mark Shannon
Hi, Apologies for my tardiness in doing this, but no one explicitly said it was too late to critique PEP 657... Critique of PEP 657 (Include Fine Grained Error Locations in Tracebacks) First of all I want to say that I