Make Dog a dataclass and create three dogs

This commit is contained in:
2025-04-22 22:16:42 -07:00
parent f58b645186
commit 4a4497bf8e

View File

@@ -1,6 +1,19 @@
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)