Bug Report
The syntax error message could perhaps be imporved when starred assignments are used incorrectly.
To Reproduce
Then run
python3 test.py
mypy test.py
Actual Behavior
I'm uncertain on what the expected behaviour should be so I'll just describe the actual behaviour, when running it under python3.11 python produces
File "/private/tmp/test.py", line 1
a = *b
^^
SyntaxError: can't use starred expression here
Whereas mypy says
test.py:1: error: Can use starred expression only as assignment target
Found 1 error in 1 file (errors prevented further checking)
Now, at a glance I thought I can do what I'm doing but it still resulted in an error, also the error seems to indicate that *a = b is fine, but that is incorrect as well.
Your Environment
- Mypy version used:
mypy 1.6.1 (compiled: yes)
- Mypy command-line flags:
--new-type-inference
- Mypy configuration options from
mypy.ini (and other config files): None
- Python version used: 3.11.5
Bug Report
The syntax error message could perhaps be imporved when starred assignments are used incorrectly.
To Reproduce
Then run
Actual Behavior
I'm uncertain on what the expected behaviour should be so I'll just describe the actual behaviour, when running it under
python3.11python producesWhereas mypy says
Now, at a glance I thought I can do what I'm doing but it still resulted in an error, also the error seems to indicate that
*a = bis fine, but that is incorrect as well.Your Environment
mypy 1.6.1 (compiled: yes)--new-type-inferencemypy.ini(and other config files): None