home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add type hints.
[plomtask]
/
days.py
diff --git
a/days.py
b/days.py
index 12328a6ed0927c5a2b970c4ef2318311156eaba7..42fc4c15280f616f0ee637503a4c98319e40d2c6 100644
(file)
--- a/
days.py
+++ b/
days.py
@@
-8,7
+8,7
@@
DATE_FORMAT = '%Y-%m-%d'
class Day:
"""Individual days defined by their dates."""
class Day:
"""Individual days defined by their dates."""
- def __init__(self, date):
+ def __init__(self, date
:str
):
self.date = date
self.datetime = datetime.strptime(date, DATE_FORMAT)
self.date = date
self.datetime = datetime.strptime(date, DATE_FORMAT)
@@
-17,8
+17,8
@@
class Day:
"""Return what weekday matches self.date."""
return self.datetime.strftime('%A')
"""Return what weekday matches self.date."""
return self.datetime.strftime('%A')
- def __eq__(self, other):
- return self.date == other.date
+ def __eq__(self, other
:object
):
+ return
isinstance(other, self.__class__) and
self.date == other.date
- def __lt__(self, other):
+ def __lt__(self, other
:Day
):
return self.date < other.date
return self.date < other.date