Require an Argument name to be a Python identifier - #3827
Conversation
|
Both of these seem like bugs. I feel like the automatic names should always be normalized and pass |
254d9e4 to
49a5f5a
Compare
OK cool, that was also my feeling. We don't want special treatments of the |
49a5f5a to
ad8601c
Compare
Aligns the constraints to `Option`'s
Argument name to be a Python identifier
@davidism Done. I did not pushed the normalization too much. So there is one bothering difference between |
Argument name to be a Python identifierArgument name to be a Python identifier
ad8601c to
3e5301b
Compare
This PR lockdown edge-cases and surprising behavior in the way Click transform arguments and options specifications and determine their canonical names.
It is in the same vein as my previous PR at #3808 , and is also based on a collection of edge-cases I accumulated over the years. It also covers platform differences between Windows and Unix-like (see: #2483).
This PR does not change the behavior of Click: it only add unitests and public documentation. I don't like some of the cases highlighted here, but I'll refrain from suggesting any change or refactoring. I'll leave that for future exploration and debates in 8.x or even 9.x releases.
Unless other maintainers point to some cases being obviously wrong and that needs fixes. In which case I'll be happy to address them.