Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

cls in classmethods of derived classes always refers to the parent class (rather than the derived one) #120

Description

Easier to explain with an example:

class Foo:
    @classmethod
    def get_an_instance(cls):
        return cls()

class Bar(Foo):
    pass

my_bar = Bar.get_an_instance()

In VSCode w/ Python plugin 2018.8.0, my_bar is typed as a Foo, while I'd expect it to be typed as a Bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions