-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Use Literal
types in argparse
#6826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Alex Waygood <[email protected]>
🤦 |
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.