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

Intersections with @final types should result in Never #451

Open
DetachHead opened this issue Apr 26, 2023 · 3 comments · May be fixed by #530
Open

Intersections with @final types should result in Never #451

DetachHead opened this issue Apr 26, 2023 · 3 comments · May be fixed by #530

Comments

@DetachHead
Copy link
Collaborator

DetachHead commented Apr 26, 2023

@final
class A: pass
class B: pass

x: A & B
reveal_type(x)  # Never
@KotlinIsland
Copy link
Owner

  • Upstream issue #15148

@zmievsa
Copy link

zmievsa commented Apr 29, 2023

Note that this proposal wouldn't necessarily affect protocols (because you do not need to inherit from it) and ABCs with overriden isinstance and issubclass hooks. Also, this feels like low priority given that mypy has the same problem already.

@KotlinIsland
Copy link
Owner

KotlinIsland commented Apr 29, 2023

How would this be affected with customized metaclass/__instancecheck__. Hmm, probably the exact same as everything currently is.

@KotlinIsland KotlinIsland linked a pull request Oct 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants