[pypy-commit] pypy py3k: simplify {date, time, datetime}.replace (constructor does field validation, no need for it here)

bdkearns noreply at buildbot.pypy.org
Wed Dec 18 03:04:20 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: py3k
Changeset: r68454:ebc1b6f37b2a
Date: 2013-12-17 21:02 -0500
http://bitbucket.org/pypy/pypy/changeset/ebc1b6f37b2a/

Log:	simplify {date,time,datetime}.replace (constructor does field
	validation, no need for it here)

diff --git a/lib-python/3/datetime.py b/lib-python/3/datetime.py
--- a/lib-python/3/datetime.py
+++ b/lib-python/3/datetime.py
@@ -806,7 +806,6 @@
             month = self._month
         if day is None:
             day = self._day
-        year, month, day = _check_date_fields(year, month, day)
         return date(year, month, day)
 
     # Comparisons of date objects with other.
@@ -1270,8 +1269,6 @@
             microsecond = self.microsecond
         if tzinfo is True:
             tzinfo = self.tzinfo
-        hour, minute, second, microsecond = _check_time_fields(hour, minute, second, microsecond)
-        _check_tzinfo_arg(tzinfo)
         return time(hour, minute, second, microsecond, tzinfo)
 
     def __bool__(self):
@@ -1486,9 +1483,6 @@
             microsecond = self.microsecond
         if tzinfo is True:
             tzinfo = self.tzinfo
-        year, month, day = _check_date_fields(year, month, day)
-        hour, minute, second, microsecond = _check_time_fields(hour, minute, second, microsecond)
-        _check_tzinfo_arg(tzinfo)
         return datetime(year, month, day, hour, minute, second, microsecond,
                         tzinfo)
 


More information about the pypy-commit mailing list