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

Safe handling of Self typed attributes w.r.t. overrides. #14074

Open
ilevkivskyi opened this issue Nov 12, 2022 · 0 comments
Open

Safe handling of Self typed attributes w.r.t. overrides. #14074

ilevkivskyi opened this issue Nov 12, 2022 · 0 comments
Labels

Comments

@ilevkivskyi
Copy link
Member

This is a follow up for #14041

This example doesn't give an error, while it probably should:

from typing import Self

class C:
    x: Self

class D(C):
    x: D  # Note this is already unsafe, but it essentially same as #2353 (for methods)

class E(D):
    pass  # This creates conflicting types for `x` from `C` and from `D`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant