Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of Type[...] so distinguish between types and instances properly #33

Open
DinoV opened this issue Jul 6, 2021 · 0 comments
Labels
sp-correctness static python correctness staticpython static python issues

Comments

@DinoV
Copy link
Contributor

DinoV commented Jul 6, 2021

Currently we don't really fully handle instances of types correctly. One example of this is:

def produce() -> type:
    @final
    class C:
        pass
    return C
C = produce()
reveal_type(C)

The inferred type of "C" becomes "Type[type]", when it really should be "Type[object]", "Type[typing.Any]" or "Type[dynamic]".

There's other places that tie into this like can_assign_from might be better taking a Value vs. a class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sp-correctness static python correctness staticpython static python issues
Projects
None yet
Development

No branches or pull requests

1 participant