[Python-checkins] python/nondist/sandbox/datetime doc.txt,1.5,1.6

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2002年12月04日 16:40:36 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv17668
Modified Files:
	doc.txt 
Log Message:
Clarified some subtleties.
Index: doc.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/doc.txt,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** doc.txt	4 Dec 2002 22:08:21 -0000	1.5
--- doc.txt	5 Dec 2002 00:40:30 -0000	1.6
***************
*** 101,111 ****
 
 - timedelta + timedelta -> timedelta
! This is exact, but may overflow.
 
 - timedelta - timedelta -> timedelta
! This is exact, but may overflow.
 
 - timedelta * (int or long) -> timedelta
! This is exact, but may overflow.
 
 - certain additions and subtractions with date, datetime, and datimetz
--- 101,120 ----
 
 - timedelta + timedelta -> timedelta
! This is exact, but may overflow. After
! t1 = t2 + t3
! t1-t2 == t3 and t1-t3 == t2 are true.
 
 - timedelta - timedelta -> timedelta
! This is exact, but may overflow. After
! t1 = t2 - t3
! t2 == t1 + t3 is true.
 
 - timedelta * (int or long) -> timedelta
! (int or long) * timedelta -> timedelta
! This is exact, but may overflow. After
! t1 = t2 * i
! t1 // i == t2 is true, provided i != 0. In general,
! t * i == t * (i-1) + t
! is true.
 
 - certain additions and subtractions with date, datetime, and datimetz
***************
*** 116,121 ****
 Division by 0 raises ZeroDivisionError.
 
! - unary plus, minus, abs
! These are exact, but unary minus may overflow.
 
 - comparison of timedelta to timedelta
--- 125,139 ----
 Division by 0 raises ZeroDivisionError.
 
! - +timedelta -> timedelta
! Returns a timedelta object with the same value.
! 
! - -timedelta -> timedelta
! -t is equivalent to timedelta(-t.days, -t.seconds, -t.microseconds),
! and to t*-1. This is exact, but may overflow (for example,
! -time.max is not representable as a timedelta object).
! 
! - abs(timedelta) -> timedelta
! abs(t) is equivalent to +t when t.days >= 0, and to -t when
! t.days < 0. This is exact, and cannot overflow.
 
 - comparison of timedelta to timedelta
***************
*** 155,159 ****
 
 Return the current local date. This is equivalent to
! fromtimestamp(time.time()).
 
 - fromtimestamp(timestamp)
--- 173,177 ----
 
 Return the current local date. This is equivalent to
! date.fromtimestamp(time.time()).
 
 - fromtimestamp(timestamp)
***************
*** 170,174 ****
 where January 1 of year 1 has ordinal 1. ValueError is raised
 unless 1 <= ordinal <= date.max.toordinal(). For any date d,
! d.fromordinal(d.toordinal()) == d
 
 Class attributes:
--- 188,192 ----
 where January 1 of year 1 has ordinal 1. ValueError is raised
 unless 1 <= ordinal <= date.max.toordinal(). For any date d,
! date.fromordinal(d.toordinal()) == d.
 
 Class attributes:
***************
*** 202,206 ****
 
 - date1 - timedelta -> date2
! The same as date1 + (-timedelta).
 
 - date1 - date2 -> timedelta
--- 220,227 ----
 
 - date1 - timedelta -> date2
! Computes the date2 such that date2 + timedelta == date1. This
! isn't quite equivalent to date1 + (-timedelta), because -timedelta
! in isolation can overflow in cases where date1 - timedelta does
! not.
 
 - date1 - date2 -> timedelta
***************
*** 210,214 ****
 
 - comparison of date to date, where date1 is considered less than
! date2 when date1 precedes date2 in time.
 
 - hash, use as dict key
--- 231,236 ----
 
 - comparison of date to date, where date1 is considered less than
! date2 when date1 precedes date2 in time. In other words,
! date1 < date2 if and only if date1.toordinal() < date2.toordinal().
 
 - hash, use as dict key

AltStyle によって変換されたページ (->オリジナル) /