False positive generalized unpacking detection with starred expression as assignment target
See original GitHub issueStarred expressions are allowed as assignment targets for Python < 3.5:
root@f1b4a742d8fc:/# python3.4
Python 3.4.10 (default, Mar 29 2019, 18:50:06)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> *x, y = [1, 2, 3]
>>> x
[1, 2]
>>> y
3
>>> z = *x, y
File "<stdin>", line 1
SyntaxError: can use starred expression only as assignment target
Currently vermin falsely report this case as 3.5+:
>>> vermin.detect('*x, y = [1, 2, 3]')
[None, (3, 5)]
Maybe we need to mark some flags such as self.__seen_assign_target in visit_Assign and treat the targets attribute specially.
Environment
- Vermin version 1.0.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Unpacking with starred assignments | Pydon't - Mathspp
A Python code snippet unpacking a list with starred assignment. (If you are new here and have no idea what a Pydon't is,...
Read more >Why is this unpacking expression not allowed in python3.10?
There's an official discussion here. The most relevant quote I can find is: Also the current behavior allows (*x), y = 1 assignment....
Read more >Broken on Python 3.4: SyntaxError: can use starred ... - GitHub
If I run dazel==0.0.33 I get the following error: > virtualenv -p python3 env > env/bin/python3 --version Python 3.4.3 > env/bin/pip install ...
Read more >star-needs-assignment-target / E0114 - Pylint 2.16.0-dev ...
Can use starred expression only in assignment target. Description: Emitted when a star expression is not used in an assignment target. Problematic code:....
Read more >Pylint Documentation - Read the Docs
Pylint tries hard to report as few false positives as possible for errors ... when a star expression is used as a starred...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Three issues:
ast.iter_child_nodes):Great. It’s merged. Thanks again!