We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e497d9 commit 852d2b6Copy full SHA for 852d2b6
python-double-underscore/article_v1.py
@@ -17,23 +17,3 @@ def update_pub_date(self, pub_date=None):
17
def compute_age(self):
18
now = datetime.datetime.now()
19
return now - self.pub_date
20
-
21
22
-class Article:
23
- def __init__(self, title, author, pub_date=None):
24
- self.title = title
25
- self.author = author
26
- self.pub_date = self.__update_pub_date(pub_date)
27
28
- def update_pub_date(self, pub_date=None):
29
- if pub_date is None:
30
- date = datetime.datetime.now()
31
- else:
32
- date = datetime.datetime.fromisoformat(pub_date)
33
- return date
34
35
- __update_pub_date = update_pub_date
36
37
- def compute_age(self):
38
- now = datetime.datetime.now()
39
- return now - self.pub_date
0 commit comments