Skip to content

stubtest: Recognize __ as indicating positional-only arg at runtime #15302

Closed
@JelleZijlstra

Description

@JelleZijlstra

I got this error on typing-extensions:

error: typing_extensions.override is inconsistent, stub argument "__arg" should be positional or keyword (remove leading double underscore)
Stub: in file stdlib\typing_extensions.pyi:366
def [_F <: def (*Any, **Any) -> Any] (_F`-1) -> _F`-1
Runtime: in file C:\Users\RUNNER~1\AppData\Local\Temp\tmp769672by\Lib\site-packages\typing_extensions.py:2403
def (__arg: ~_F) -> ~_F

Since typing_extensions.override uses __arg at runtime, I think stubtest should recognize it as positional-only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions