Use Literal types in argparse#6826
Use Literal types in argparse#6826sobolevn wants to merge 4 commits intopython:masterfrom sobolevn:patch-70
Literal types in argparse#6826Conversation
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
🤦 |
|
Diff from mypy_primer, showing the effect of this PR on open source code: cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/argparser.py: note: In function "arg_parser":
+ cwltool/argparser.py:460:51: error: Incompatible types in assignment (expression has type "Literal['Dependency resolver ']", variable has type "Literal['==SUPPRESS==']") [assignment]
+ cwltool/argparser.py:464:13: error: Incompatible types in assignment (expression has type "Literal['Defaut root directory used by dependency resolvers configuration.']", variable has type "Literal['==SUPPRESS==']") [assignment]
+ cwltool/argparser.py:466:34: error: Incompatible types in assignment (expression has type "Literal['Use biocontainers for tools without an ']", variable has type "Literal['==SUPPRESS==']") [assignment]
+ cwltool/argparser.py:469:13: error: Incompatible types in assignment (expression has type "Literal["Short cut to use Conda to resolve 'SoftwareRequirement' packages."]", variable has type "Literal['==SUPPRESS==']") [assignment]
|
|
With this in mind, I'm not sure if |
|
@Akuli thanks for the interesting use-case, I was not aware of that 🙂 But, I still think that |
|
But the constants really aren't meant to be treated as strings, but as special sentinel objects. |
|
Closing per @Akuli's comment; there is also a merge conflict. |
No description provided.