[Python-checkins] CVS: python/nondist/sandbox/datetime datetime.py,1.52,1.53

Tim Peters tim_one@users.sourceforge.net
Tue, 05 Mar 2002 11:11:45 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory usw-pr-cvs1:/tmp/cvs-serv24539

Modified Files:
	datetime.py 
Log Message:
Hmm.  Either some fiddling to timedelta.__init__ got lost via another
checkin, or I forgot to check it in to begin with.


Index: datetime.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** datetime.py	5 Mar 2002 14:14:48 -0000	1.52
--- datetime.py	5 Mar 2002 19:11:43 -0000	1.53
***************
*** 338,341 ****
--- 338,342 ----
              d = days
          assert isinstance(daysecondsfrac, float)
+         assert abs(daysecondsfrac) <= 1.0
          assert isinstance(d, (int, long))
          assert abs(s) <= 24 * 3600
***************
*** 346,352 ****
              assert seconds == long(seconds)
              seconds = long(seconds)
          else:
!             secondsfrac = 0.0
          assert isinstance(secondsfrac, float)
          assert isinstance(seconds, (int, long))
          days, seconds = divmod(seconds, 24*3600)
--- 347,358 ----
              assert seconds == long(seconds)
              seconds = long(seconds)
+             secondsfrac += daysecondsfrac
+             assert abs(secondsfrac) <= 2.0
          else:
!             secondsfrac = daysecondsfrac
!         # daysecondsfrac isn't referenced again
          assert isinstance(secondsfrac, float)
+         assert abs(secondsfrac) <= 2.0
+ 
          assert isinstance(seconds, (int, long))
          days, seconds = divmod(seconds, 24*3600)
***************
*** 357,365 ****
          # seconds isn't referenced again before redefinition
  
-         secondsfrac += daysecondsfrac
-         assert -2.0 <= secondsfrac <= 2.0
          usdouble = secondsfrac * 1e6
!         assert -2.1e6 < usdouble < 2.1e6    # exact value not critical
!         # secondsfrac & daysecondsfrac aren't referenced again
  
          if isinstance(microseconds, float):
--- 363,369 ----
          # seconds isn't referenced again before redefinition
  
          usdouble = secondsfrac * 1e6
!         assert abs(usdouble) < 2.1e6    # exact value not critical
!         # secondsfrac isn't referenced again
  
          if isinstance(microseconds, float):
***************
*** 387,391 ****
              microseconds = round(microseconds)
          assert abs(s) <= 3 * 24 * 3600
!         assert abs(microseconds) <= 3.1e6
  
          # Just a little bit of carrying possible for microseconds and seconds.
--- 391,395 ----
              microseconds = round(microseconds)
          assert abs(s) <= 3 * 24 * 3600
!         assert abs(microseconds) < 3.1e6
  
          # Just a little bit of carrying possible for microseconds and seconds.