[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-07-13 Thread Mats Wichmann
On 7/12/22 00:11, John Belmonte wrote: > On 1/18/22 10:43 AM, Mats Wichmann wrote: > >> A thought - how about omitting the underline line if the >> to-be-underlined part would be the whole line? > > I wasn't aware of this thread, but that's exactly what I implemented for > 3.11.0b4. > > About th

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-07-11 Thread John Belmonte
On 1/18/22 10:43 AM, Mats Wichmann wrote: > A thought - how about omitting the underline line if the > to-be-underlined part would be the whole line? I wasn't aware of this thread, but that's exactly what I implemented for 3.11.0b4. About this thread-- I understand debating solutions, but there

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-20 Thread Barry Scott
> On 20 Jan 2022, at 02:22, Skip Montanaro wrote: > > (This really belongs on python-ideas, right?) > I'm commenting on the implementation that is on going. python-ideas does not seem right. Barry ___ Python-Dev mailing list -- python-dev@python.

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-19 Thread Skip Montanaro
> > It would not be nice if the traceback module API started providing > text with embedded escape sequences without a way to turn then off in the > API. > I think fobj.isatty() would give the traceback module a good idea whether it's writing to a display device or not. There are a number of other

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-19 Thread Terry Reedy
On 1/19/2022 5:01 PM, Barry Scott wrote: Oh and if you use colours then you please give me the ability to set the colours for each usage. IDLE has that for Error Text, along with other colors. I have custom colour settings for a lots of unix too ls so that I get contrast etc. The defaults us

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-19 Thread Barry Scott
> On 19 Jan 2022, at 21:19, Ethan Furman wrote: > > An environment variable would solve this, yes? The default would be using > the underlining carets, but an env var could switch that to using color > instead. Oh and if you use colours then you please give me the ability to set the colour

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-19 Thread Barry Scott
> On 19 Jan 2022, at 21:19, Ethan Furman wrote: > > On 1/19/22 1:10 PM, Barry Scott wrote: > > On 18 Jan 2022, at 19:59, Pablo Galindo Salgado wrote: > > >> We considered using colours and other markers such as bold text, but that > >> opens a considerable can of worms with > >> detecting in

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-19 Thread Ethan Furman
On 1/19/22 1:10 PM, Barry Scott wrote: > On 18 Jan 2022, at 19:59, Pablo Galindo Salgado wrote: >> We considered using colours and other markers such as bold text, but that opens a considerable can of worms with >> detecting in all systems and configurations if that can be done. I have been tol

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-19 Thread Barry Scott
> On 18 Jan 2022, at 19:59, Pablo Galindo Salgado wrote: > > We considered using colours and other markers such as bold text, but that > opens a considerable can of worms with detecting in all systems and > configurations if that can be done. I have been told that some of these > situations

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread MRAB
On 2022-01-18 21:58, Pablo Galindo Salgado wrote: The code that computes the lines is already quite complex (to the point that has to do some AST analysis and post-parsing) so I am quite worried to introduce a lot of complexity in this area. I am fine doing something that we can easily check fo

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Pablo Galindo Salgado
The code that computes the lines is already quite complex (to the point that has to do some AST analysis and post-parsing) so I am quite worried to introduce a lot of complexity in this area. I am fine doing something that we can easily check for (spawns all the line) but I would be against having

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Patrick Reader
On 18/01/2022 20:41, Pablo Galindo Salgado wrote: We cannot base the computation on a % because is possible that the location markers are relevant but the variables, function names or constructs are just very large. I think that the idea of "spawns the whole line" is sensible, though. On Tue,

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Barney Gale
tox and pytest look at PY_COLORS: https://github.com/tox-dev/tox/blob/9cc692d85c9ce84344ea7fee4b127755c6099a32/src/tox/session/commands/help.py https://docs.pytest.org/en/6.2.x/reference.html#envvar-PY_COLORS On Tue, 18 Jan 2022 at 21:17, Ethan Furman wrote: > On 1/18/22 11:59 AM, Pablo Galindo

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Ethan Furman
On 1/18/22 11:59 AM, Pablo Galindo Salgado wrote: > We considered using colours and other markers such as bold text, but that opens a considerable can of worms with > detecting in all systems and configurations if that can be done. I have been told that some of these situations are > quite tric

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Pablo Galindo Salgado
We cannot base the computation on a % because is possible that the location markers are relevant but the variables, function names or constructs are just very large. I think that the idea of "spawns the whole line" is sensible, though. On Tue, 18 Jan 2022 at 20:32, Steve Dower wrote: > On 1/18/2

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Steve Dower
On 1/18/2022 7:59 PM, Pablo Galindo Salgado wrote: We considered using colours and other markers such as bold text, but that opens a considerable can of worms with detecting in all systems and configurations if that can be done. I have been told that some of these situations are quite tricky an

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Pablo Galindo Salgado
We considered using colours and other markers such as bold text, but that opens a considerable can of worms with detecting in all systems and configurations if that can be done. I have been told that some of these situations are quite tricky and is not as easy as checking for tty support. If someo

[Python-Dev] Re: 3.11 enhanced error location - can it be smarter?

2022-01-18 Thread Ethan Furman
On 1/18/22 10:43 AM, Mats Wichmann wrote: > A thought - how about omitting the underline line if the > to-be-underlined part would be the whole line? I would also like that change -- when the underlining is a portion of the whole it's quite useful, but when it's the whole line it's a lot of ext