Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created May 24, 2024 22:00
Show Gist options
  • Save mypy-play/344d58d4a20fb433837b99812e1beb9e to your computer and use it in GitHub Desktop.
Save mypy-play/344d58d4a20fb433837b99812e1beb9e to your computer and use it in GitHub Desktop.
Shared via mypy Playground
class X:
val: object
class Y(X):
@property
def val(self) -> object:
return object()
@val.setter
def val(self, value):
self.x = True
class Z(X):
@property
def val(self):
return object()
a: X = Z()
a.val = 3
class A:
def f(self, a):
print(a)
class B(A):
def f(self) -> None:
print(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment