Skip to content

Type parameter defaults do not get bound when accessing a method #5830

@Gobot1234

Description

@Gobot1234

Describe the bug
Accessing a method on a class does not bind any associated type parameters to their default value leaving types unknown. I don't think this is described in PEP 696 but I can add it if you think it should be.

Code or Screenshots

class Foo[T = int]:
    def bar(self) -> None:
        ...

Foo.bar(Foo())
image

VS Code extension or command-line
pylance v2023.8.40

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions