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

(😕) --allow-incomplete-defs can be misleading and confusing #12256

Closed
KotlinIsland opened this issue Feb 26, 2022 · 1 comment
Closed

(😕) --allow-incomplete-defs can be misleading and confusing #12256

KotlinIsland opened this issue Feb 26, 2022 · 1 comment

Comments

@KotlinIsland
Copy link
Contributor

KotlinIsland commented Feb 26, 2022

def f(i) -> None: ...
def f2(i): ...
>mypy --strict --allow-incomplete-defs test.py
test.py:1: error: Function is missing a type annotation for one or more arguments
test.py:2: error: Function is missing a type annotation
Found 2 errors in 1 file (checked 1 source file)

I read this as "be strict, but allow partially typed defs" and not show an error on the first line, but it actually only means "be strict".

As far as I can tell there is no such functionality as "allow partially typed defs" due to --disallow-untyped-defs applying to incomplete as well as completely untyped defs.

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented May 18, 2023

Closing this feature request since it hasn't attracted much attention. I'm not sure I really see the use case for this feature either. Since mypy doesn't attempt cross-function inference, it's mostly a liability if mypy shuts up if just one argument is annotated, and there isn't a strong gradual typing case to be made for it.

#15247 addresses some general confusion here

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants