Skip to content

stubtest false positive for ... in param default #12819

@JelleZijlstra

Description

@JelleZijlstra

From python -m mypy.stubtest --custom-typeshed-dir . wsgiref:

error: wsgiref.types._Readable.read is inconsistent, runtime argument "size" has a default value of type builtins.ellipsis, which is incompatible with stub argument type builtins.int
Stub: at line 28
def (self: wsgiref.types._Readable, builtins.int =) -> builtins.bytes
Runtime: at line 47 in file /Users/jelle/py/cpython/Lib/wsgiref/types.py
def (self, size: int = Ellipsis, /) -> bytes

The stub and implementation are exactly the same.

Probably stubtest should handle runtime Protocols more smartly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions