[Python-checkins] r82145 - sandbox/branches/py3k-datetime/datetime.py
alexander.belopolsky
python-checkins at python.org
Mon Jun 21 20:14:01 CEST 2010
Author: alexander.belopolsky
Date: Mon Jun 21 20:14:01 2010
New Revision: 82145
Log:
Removed more unused code
Modified:
sandbox/branches/py3k-datetime/datetime.py
Modified: sandbox/branches/py3k-datetime/datetime.py
==============================================================================
--- sandbox/branches/py3k-datetime/datetime.py (original)
+++ sandbox/branches/py3k-datetime/datetime.py Mon Jun 21 20:14:01 2010
@@ -67,11 +67,9 @@
def _ymd2ord(year, month, day):
"year, month, day -> ordinal, considering 01-Jan-0001 as day 1."
- if not 1 <= month <= 12:
- raise ValueError('month must be in 1..12', month)
+ assert 1 <= month <= 12, 'month must be in 1..12'
dim = _days_in_month(year, month)
- if not 1 <= day <= dim:
- raise ValueError('day must be in 1..%d' % dim, day)
+ assert 1 <= day <= dim, ('day must be in 1..%d' % dim)
return (_days_before_year(year) +
_days_before_month(year, month) +
day)
@@ -805,11 +803,6 @@
# Computations
- def _checkOverflow(self, year):
- if not MINYEAR <= year <= MAXYEAR:
- raise OverflowError("date +/-: result year %d not in %d..%d" %
- (year, MINYEAR, MAXYEAR))
-
def __add__(self, other):
"Add a date to a timedelta."
if isinstance(other, timedelta):
More information about the Python-checkins
mailing list