[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread David Mertz
For what it's worth, after 20+ years of using Python, forgetting the colon for blocks remains the most common error I make by a fairly wide margin. Of course, once I see the error message—even being not all that descriptive of the real issue—I immediately know what to fix too. On Tue, Jan 14,

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread Naomi Ceder
My pleasure! Glad to see you have discussed with André! On Tue, 14 Jan 2020 at 13:52, Ntentos Stavros wrote: > For the sake of completeness: friendly-traceback is already handling > this. @Naomi Thank you for bringing this up :-) > > https://github.com/aroberge/friendly-traceback/issues/42 > --

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread Ntentos Stavros
For the sake of completeness: friendly-traceback is already handling this. @Naomi Thank you for bringing this up :-) https://github.com/aroberge/friendly-traceback/issues/42 -- Yours faithfully, Ntentos Stavros ___ Python-ideas mailing list --

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread Σταύρος Ντέντος
On Tue, 14 Jan 2020 at 20:43, Guido van Rossum wrote: > > On the subject of replacing the current parser, I am actively working on > that. See GitHub.com/gvanrossum/pegen. Sounds interesting! I could open you a ticket, if something like that is not implemented / in your plans currently. > > On

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread Naomi Ceder
The friendly-traceback project (in early alpha) is working on making traceback messages more helpful and translatable - https://aroberge.github.io/friendly-traceback-docs/docs/html/ On Tue, 14 Jan 2020 at 12:43, Guido van Rossum wrote: > On the subject of replacing the current parser, I am

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread Guido van Rossum
On the subject of replacing the current parser, I am actively working on that. See GitHub.com/gvanrossum/pegen. On Tue, Jan 14, 2020 at 10:32 Andrew Barnert via Python-ideas < python-ideas@python.org> wrote: > On Jan 14, 2020, at 05:22, Σταύρος Ντέντος wrote: > > > > Hello there, > > > > If I

[Python-ideas] Re: Improve SyntaxError for obvious issue:

2020-01-14 Thread Andrew Barnert via Python-ideas
On Jan 14, 2020, at 05:22, Σταύρος Ντέντος wrote: > > Hello there, > > If I have simply missed a double colon starting a for loop > > File "./bbq.py", line 160 >for config_file in config_files > ^ > SyntaxError: invalid syntax > > the message is not as

[Python-ideas] Re: f(doc)string resource imports

2020-01-14 Thread Ned Batchelder
On 1/14/20 12:44 PM, Soni L. wrote: We have importlib resources. We should put it to use. Imagine if you could separate your docs from your code and yet include them in your package. ``` f"""{from mymodule.docs include main.rst}""" def foo():   f"""{from mymodule.docs include foo.rst}"""  

[Python-ideas] f(doc)string resource imports

2020-01-14 Thread Soni L.
We have importlib resources. We should put it to use. Imagine if you could separate your docs from your code and yet include them in your package. ``` f"""{from mymodule.docs include main.rst}""" def foo():   f"""{from mymodule.docs include foo.rst}"""   pass class Bar:   f"""{from

[Python-ideas] Re: Recommend UTF-8 mode on Windows

2020-01-14 Thread Stephen J. Turnbull
Andrew Barnert writes: > On Jan 13, 2020, at 19:32, Stephen J. Turnbull > wrote: > > > > There is still tons of data in legacy > > applications, both as text files and in various application data > > formats, that use legacy encodings (in Japanese, that means MBCS). > > Sadly, it's not

[Python-ideas] Improve SyntaxError for obvious issue:

2020-01-14 Thread Σταύρος Ντέντος
Hello there, If I have simply missed a double colon starting a for loop File "./bbq.py", line 160 for config_file in config_files ^ SyntaxError: invalid syntax the message is not as straightforward. I am not sure what the status quo of these messages

[Python-ideas] Re: Recommend UTF-8 mode on Windows

2020-01-14 Thread Eryk Sun
On 1/14/20, Inada Naoki wrote: > > UTF-8 mode shouldn't take precedence over legacy FS encoding. > > Mercurial uses legacy encoding for file paths. They use > sys._enablelegacywindowsfsencoding() on Windows. > https://www.mercurial-scm.org/repo/hg/rev/8d5489b048b7 This runtime call can override

[Python-ideas] Re: Recommend UTF-8 mode on Windows

2020-01-14 Thread Inada Naoki
On Sun, Jan 12, 2020 at 9:32 PM Eryk Sun wrote: > > In both of the above cases, what I'd prefer is for UTF-8 mode to take > precedence over legacy modes, i.e. to disable > config->legacy_windows_fs_encoding and config->legacy_windows_stdio in > the startup configuration. > UTF-8 mode shouldn't