8000 Changed calendar.py to define lists of literals instead of tuples. · python/cpython@eb23155 · GitHub
[go: up one dir, main page]

Skip to content

Commit eb23155

Browse files
committed
Changed calendar.py to define lists of literals instead of tuples.
Got rid of old module 'localtime.py'.
1 parent ca7b213 commit eb23155

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Lib/calendar.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def isleap(year):
2323
February = 2
2424

2525
# Number of days per month (except for February in leap years)
26-
mdays = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
26+
mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
2727

2828
# Exception raised for bad input (with string parameter for details)
2929
error = 'calendar error'
@@ -67,16 +67,16 @@ def mktime(year, month, day, hours, mins, secs):
6767
return ((days*24 + hours)*60 + mins)*60 + secs
6868

6969
# Full and abbreviated names of weekdays
70-
day_name = ('Monday', 'Tuesday', 'Wednesday', 'Thursday')
71-
day_name = day_name + ('Friday', 'Saturday', 'Sunday')
72-
day_abbr = ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun')
70+
day_name = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', \
71+
'Friday', 'Saturday', 'Sunday']
72+
day_abbr = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
7373

7474
# Full and abbreviated of months (1-based arrays!!!)
75-
month_name = ('', 'January', 'February', 'March', 'April')
76-
month_name = month_name + ('May', 'June', 'July', 'August')
77-
month_name = month_name + ('September', 'October', 'November', 'December')
78-
month_abbr = (' ', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun')
79-
month_abbr = month_abbr + ('Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')
75+
month_name = ['', 'January', 'February', 'March', 'April', \
76+
'May', 'June', 'July', 'August', \
77+
'September', 'October', 'November', 'December']
78+
month_abbr = [' ', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', \
79+
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
8080

8181
# Zero-fill string to two positions (helper for asctime())
8282
def dd(s):

0 commit comments

Comments
 (0)
0