Skip to content

Instantly share code, notes, and snippets.

@Armen-Jean-Andreasian
Last active April 24, 2024 01:03
Show Gist options
  • Save Armen-Jean-Andreasian/de701aed15c6cd7a828eef035031d4c5 to your computer and use it in GitHub Desktop.
Save Armen-Jean-Andreasian/de701aed15c6cd7a828eef035031d4c5 to your computer and use it in GitHub Desktop.
from typing import Callable
class B:
def b(self):
...
@property
def bb(self) -> Callable:
return self.b
@bb.setter
def bb(self, new: Callable):
self.b = new
if __name__ == '__main__':
b = B()
b.bb = print
b.b('hello world')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment