Skip to content

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

Closed as not planned
@KotlinIsland

Description

@KotlinIsland
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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions