summaryrefslogtreecommitdiffstats
path: root/Lib/datetime.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-08-29 21:27:57 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-08-29 21:27:57 (GMT)
commitf908efb75cfb7891a42b5a9ec9e0100b8c758101 (patch)
tree39f605c0370d096e943c38d7e29d53aed58445db /Lib/datetime.py
parent6cc50391a600b010d3cdc944d5355c93654da43f (diff)
downloadcpython-f908efb75cfb7891a42b5a9ec9e0100b8c758101.zip
cpython-f908efb75cfb7891a42b5a9ec9e0100b8c758101.tar.gz
cpython-f908efb75cfb7891a42b5a9ec9e0100b8c758101.tar.bz2
make lists uniformly integers for the benefit of pypy
Diffstat (limited to 'Lib/datetime.py')
-rw-r--r--Lib/datetime.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/datetime.py b/Lib/datetime.py
index 197ef63..b64637f 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -23,9 +23,10 @@ _MAXORDINAL = 3652059 # date.max.toordinal()
# for all computations. See the book for algorithms for converting between
# proleptic Gregorian ordinals and many other calendar systems.
-_DAYS_IN_MONTH = [None, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+# -1 is a placeholder for 0.
+_DAYS_IN_MONTH = [-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
-_DAYS_BEFORE_MONTH = [None]
+_DAYS_BEFORE_MONTH = [-1] # -1 is a placeholder for 0.
dbm = 0
for dim in _DAYS_IN_MONTH[1:]:
_DAYS_BEFORE_MONTH.append(dbm)