Skip to content

Instantly share code, notes, and snippets.

@MapleCCC
Last active January 6, 2022 09:24
Show Gist options
  • Save MapleCCC/3f3e11d471b894971857474411eb75ea to your computer and use it in GitHub Desktop.
Save MapleCCC/3f3e11d471b894971857474411eb75ea to your computer and use it in GitHub Desktop.
男人类
class 男人(人):
def __init__(self, name: str, beard_density: float) -> None:
super().__init__(name)
self.beard_density = beard_density
@property
def 胡须密度(self) -> float:
return self.beard_density
def ejaculate(self) -> None:
# some syscall code that yield side effects
def 任职消防员(self) -> None:
# some syscall code that yield side effects
man = 男人(name="李阳", beard_density=2.3)
print(man.名字) # "李阳"
print(man.胡须密度) # 2.3
man.说话() # "你好!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment