Skip to content

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

Open
@ilevkivskyi

Description

@ilevkivskyi

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`.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions