Skip to content
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

update mypy to use --no-implicit-optional arg #23824

Closed
kristapratico opened this issue Apr 5, 2022 · 2 comments
Closed

update mypy to use --no-implicit-optional arg #23824

kristapratico opened this issue Apr 5, 2022 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system.

Comments

@kristapratico
Copy link
Member

This mypy option will enforce using typing.Optional when a default argument of None is stated:

def func(a: int = None):
    return a

main.py:36: error: Incompatible default for argument "a" (default has type "None", argument has type "int")

@kristapratico kristapratico added Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system. labels Apr 5, 2022
@kristapratico kristapratico self-assigned this Apr 5, 2022
@kristapratico
Copy link
Member Author

The pyright equivalent is strictParameterNoneValue. https://github.com/microsoft/pyright/blob/main/docs/configuration.md

@kristapratico
Copy link
Member Author

We get this for free with pyright and we'll get this in mypy when we bump our currently pinned version (TBD) because this option is now enabled by default.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system.
Projects
None yet
Development

No branches or pull requests

1 participant