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

Skip to content

(🐞) Modules don't really conform to Protocols do they #16890

Closed as not planned
@KotlinIsland

Description

@KotlinIsland

test.py

from typing import Protocol

import test2

class P(Protocol):
    def foo(self) -> None: ...

a: P = test2
reveal_type(type(a).foo)  # Revealed type is "def (self: test.P) -> None"

test2.py

def foo() -> None: ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions