Thanks to visit codestin.com
Credit goes to github.com

Skip to content

stubtest false positive for Protocol __init__ #12820

Closed
@JelleZijlstra

Description

@JelleZijlstra

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

error: wsgiref.types._Readable.__init__ is inconsistent, stub does not have *args argument "args"
Stub: at line 87
def (self: builtins.object)
Runtime: at line 1912 in file /Users/jelle/py/cpython/Lib/typing.py
def (self, *args, **kwargs)

The stub and implementation are exactly the same.

Stubtest picks up the __init__ method the runtime injects for Protocols, but it's not useful.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions