19 lines
253 B
Python
19 lines
253 B
Python
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class Dog:
|
|
name: str
|
|
|
|
def __del__(self):
|
|
global heaven
|
|
heaven.append(self)
|
|
|
|
|
|
heaven = []
|
|
|
|
if __name__ == "__main__":
|
|
Dog("Fido")
|
|
Dog("Rex")
|
|
Dog("Spot")
|
|
print(heaven)
|