summaryrefslogtreecommitdiffstats
path: root/ExampleSubmission/example.py
diff options
context:
space:
mode:
Diffstat (limited to 'ExampleSubmission/example.py')
-rw-r--r--ExampleSubmission/example.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/ExampleSubmission/example.py b/ExampleSubmission/example.py
index a226adb..cc61122 100644
--- a/ExampleSubmission/example.py
+++ b/ExampleSubmission/example.py
@@ -2,6 +2,7 @@
# 12-01-21
import tkinter as tk
+from dataclasses import dataclass
class Application(tk.Tk):
"""An example class, which implements a GUI by inheriting from tkinter.Tk
@@ -35,6 +36,19 @@ class Application(tk.Tk):
"""
return num1 + num2
+@dataclass
+class MyDate:
+ year:int
+ month:int
+ day:int
+
+ def __eq__(self, otherDate):
+ return self.year == otherDate.year and self.month == otherDate.month and self.day == otherDate.day
+
+ def __str__(self):
+ "%d-%d-%4d" % (self.day, self.month, self.year)
+
+
# hello world!
def hello_world(times):
"""Prints 'hello world!' to stdout. Prints it out `times` times.