Bug #16344
closedCan be assigned to numbered parameter when after used _1
Description
Steps to reproduce¶
- Define local variable
_1outside block - Call Numbered parameter in block
- Assign for
_1
Expected behavior¶
Actual behavior¶
Cannot be assinged to numbered parameter from #16293.
However, can be assinged to numbered parameter if defined local variable _1 outside block.
I think this is a bug.
Updated by osyo (manga osyo) almost 7 years ago
- Description updated (diff)
Updated by Hanmac (Hans Mackowiak) almost 7 years ago
i think this has something to do with that _* parameter doesn't cause duplicate syntax errors:
See some of your examples from #16293
Updated by jeremyevans0 (Jeremy Evans) over 6 years ago
- Status changed from Open to Closed
Assigning to the numbered parameter is now a SyntaxError even if it is a local variable in scope, so current master has your expected behavior.
Related to this, accessing the numbered parameter inside a block in master accesses the numbered parameter, even if a local variable of the same name exists in the outer scope:
I think we should make assigning to a numbered parameter a SyntaxError instead of a warning outside of a block (it was a warning in 2.7). I'll submit a feature request for that.