This isn't a "professional" or probably even "valid" use case for Python
but one area this behavior is heavily used is code golf. For those not
familiar with code golf is a type of puzzle where the objective is to
complete a set of requirements in the least number of source code
characters as possi
Also, would it be possible to enhance to tokenizer to report a
SyntaxWarning, rather than a SyntaxError?
Victor
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailm
I feel like all of these examples, if found in the wild, are far more
likely to be uncaught bugs than programmer intent. Being strict about
spaces (or parents, brackets, etc. in other contexts) around numbers is
much more straightforward than a number of edge cases where is not obvious
what will ha
It would be useful to first estimate how many projects would be broken
by such incompatible change (stricter syntax).
Inada-san wrote
https://github.com/methane/notes/blob/master/2020/wchar-cache/download_sdist.py
to download source files using
https://hugovk.github.io/top-pypi-packages/ API (top
On 14/04/21 8:54 am, Guido van Rossum wrote:
On Tue, Apr 13, 2021 at 12:55 PM Serhiy Storchaka
>
>>> [0x1for x in (1,2)]
I would totally make that a SyntaxError, and backwards compatibility be
damned.
Indeed. Python is not Fotran!
--
Greg
__
On Apr 13, 2021, at 12:52, Serhiy Storchaka wrote:
>
> New example was found recently (see https://bugs.python.org/issue43833).
>
[0x1for x in (1,2)]
> [31]
>
> It is parsed as [0x1f or x in (1,2)] instead of [0x1 for x in (1,2)].
That’s a wonderfully terrible example! Who’s maintaining
On Tue, Apr 13, 2021 at 12:55 PM Serhiy Storchaka
wrote:
> 26.04.18 21:37, Serhiy Storchaka пише:
> > In Python 2.5 `0or[]` was accepted by the Python parser. It became an
> > error in 2.6 because "0o" became recognizing as an incomplete octal
> > number. `1or[]` still is accepted.
> >
> > On oth
26.04.18 21:37, Serhiy Storchaka пише:
> In Python 2.5 `0or[]` was accepted by the Python parser. It became an
> error in 2.6 because "0o" became recognizing as an incomplete octal
> number. `1or[]` still is accepted.
>
> On other hand, `1if 2else 3` is accepted despites the fact that "2e" can
> b