From: Benjamin Peterson Date: Thu, 29 Aug 2013 21:27:57 +0000 (-0400) Subject: make lists uniformly integers for the benefit of pypy X-Git-Tag: v3.4.0a2~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f908efb75cfb7891a42b5a9ec9e0100b8c758101;p=thirdparty%2FPython%2Fcpython.git make lists uniformly integers for the benefit of pypy --- diff --git a/Lib/datetime.py b/Lib/datetime.py index 197ef6367e8d..b64637f2d4db 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)