[Python-checkins] r82144 - sandbox/branches/py3k-datetime/datetime.py
alexander.belopolsky
python-checkins at python.org
Mon Jun 21 20:00:23 CEST 2010
Author: alexander.belopolsky
Date: Mon Jun 21 20:00:23 2010
New Revision: 82144
Log:
Removed 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:00:23 2010
@@ -48,10 +48,6 @@
"year -> 1 if leap year, else 0."
return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
-def _days_in_year(year):
- "year -> number of days in year (366 if a leap year, else 365)."
- return 365 + _is_leap(year)
-
def _days_before_year(year):
"year -> number of days before January 1st of year."
y = year - 1
@@ -66,8 +62,7 @@
def _days_before_month(year, month):
"year, month -> number of days in year preceeding first day of month."
- if not 1 <= month <= 12:
- raise ValueError('month must be in 1..12', month)
+ assert 1 <= month <= 12, 'month must be in 1..12'
return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))
def _ymd2ord(year, month, day):
More information about the Python-checkins
mailing list