[Python-checkins] cpython: make lists uniformly integers for the benefit of pypy

benjamin.peterson python-checkins at python.org
Thu Aug 29 23:28:03 CEST 2013


http://hg.python.org/cpython/rev/a6df3f045e8b
changeset:   85458:a6df3f045e8b
user:        Benjamin Peterson <benjamin at python.org>
date:        Thu Aug 29 17:27:57 2013 -0400
summary:
  make lists uniformly integers for the benefit of pypy

files:
  Lib/datetime.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/datetime.py b/Lib/datetime.py
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -23,9 +23,10 @@
 # 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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list