[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 5618c81e139419b4665dc1f1e8a468738546f542 by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-45716: Improve the error message when using True/False/None as 
keywords in a call (GH-29413). (GH-29428)
https://github.com/python/cpython/commit/5618c81e139419b4665dc1f1e8a468738546f542


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +27683
pull_request: https://github.com/python/cpython/pull/29428

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset e2d65630f36712dbdbf7711520c985c526a5cc25 by Pablo Galindo Salgado 
in branch 'main':
bpo-45716: Improve the error message when using True/False/None as keywords in 
a call (GH-29413)
https://github.com/python/cpython/commit/e2d65630f36712dbdbf7711520c985c526a5cc25


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +27665
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29413

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-04 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-04 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Parser
nosy: +lys.nikolaou, pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45716] Confusing parsing error message when trying to use True as keyword argument

2021-11-04 Thread Carl Friedrich Bolz-Tereick


New submission from Carl Friedrich Bolz-Tereick :

A bit of a nitpick, but the following SyntaxError message is a bit confusing:

>>> f(True=1)
  File "", line 1
f(True=1)
  ^
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

The problem with that line is not that it contains an assignment, it's almost a 
valid keyword argument after all. The problem is that the name of the keyword 
is True, which is no longer a name you can assign to. It would be better to 
produce the same error as with __debug__:

>>> f(__debug__=1)
  File "", line 1
SyntaxError: cannot assign to __debug__

The latter error message is however produced by the compiler, not the parser I 
think?

--
messages: 405741
nosy: Carl.Friedrich.Bolz
priority: normal
severity: normal
status: open
title: Confusing parsing error message when trying to use True as keyword 
argument

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com