[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e by Pablo Galindo in branch 'master': bpo-30858: Improve error location for expressions with assignments (GH-23753) https://github.com/python/cpython/commit/43c4fb6c90c013a00cb820cb61e4990cd8ec7f5e

[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +22610 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23753 ___ Python tracker

[issue30858] Keyword can't be an expression?

2020-12-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: +1 for the `=` sign -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue30858] Keyword can't be an expression?

2020-12-12 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: I like the current error message. What bugs me a little is the position of the caret, which I think is a bit misleading. Guido, Pablo, should we move the caret to point at the `=` sign or whatever comes after it? I think I prefer the former. --

[issue30858] Keyword can't be an expression?

2020-12-04 Thread Irit Katriel
Irit Katriel added the comment: I get this now on 3.10: >>> print(end1 + end2 + end3 + end4 + end5 + end6 + end=' ') File "", line 1 print(end1 + end2 + end3 + end4 + end5 + end6 + end=' ') ^ SyntaxError: expression cannot contain assignment, perhaps you meant "=="?

[issue30858] Keyword can't be an expression?

2018-08-27 Thread Vedran Čačić
Vedran Čačić added the comment: Nick, thanks for validating my pain. :-| In the meantime, I found out Python already knows more finely what kind of expression something is, and uses that knowledge in the error messages. Look: >>> a + b = 4 SyntaxError: can't assign to operator

[issue30858] Keyword can't be an expression?

2018-08-26 Thread Nick Coghlan
Nick Coghlan added the comment: The current error message is also outright incorrect, since simple names *are* valid expressions - the actual problem being reported is that binary expressions (veky's case) and strings (my case) *aren't* identifiers. --

[issue30858] Keyword can't be an expression?

2018-08-26 Thread Nick Coghlan
Nick Coghlan added the comment: I just ran into this, and found the existing error message *incredibly* confusing. My immediate reaction was "There's no keyword in that line, what are you complaining about?". An error message that said "Keyword argument name must be an identifier" would

[issue30858] Keyword can't be an expression?

2017-07-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I prefer the current error message and my students don't seem to have issues with it. No matter what wording we put in, someone will always find a way to misread it, in part because the "end6 + end=' '" example isn't a simple mistake, it reflects

[issue30858] Keyword can't be an expression?

2017-07-06 Thread R. David Murray
R. David Murray added the comment: If I saw your message, I would think "what is a 'simple name'?". There's no glossary entry for that, nor is it a concept used elsewhere in the documentation as far as I remember. One could instead use "single identifier", but the problem with both of

[issue30858] Keyword can't be an expression?

2017-07-05 Thread Vedran Čačić
Vedran Čačić added the comment: I agree it's more _correct_. But it's also more confusing. As far as I can tell, when writing error messages, we tend to minimize confusion, not maximize correctness. Of course, it would be great to have both. Your "keyword argument name" seems pretty good.

[issue30858] Keyword can't be an expression?

2017-07-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue29951. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue30858] Keyword can't be an expression?

2017-07-05 Thread R. David Murray
R. David Murray added the comment: I think the current error message is more informative than your suggestion, myself. However, the message could say "keyword argument name" instead of just "keyword", which I think would be quite a bit clearer. I seem to remember another discussion where I

[issue30858] Keyword can't be an expression?

2017-07-05 Thread Vedran Čačić
New submission from Vedran Čačić: Look at this (from https://www.quora.com/Is-end1-a-keyword-in-Python-3-6-1): print(end1 + end2 + end3 + end4 + end5 + end6 + end=' ') ^ SyntaxError: keyword can't be an expression Wouldn't it be better if the message said "keyword for an argument must