[Python-checkins] python/dist/src/Doc/lib libdatetime.tex,1.3,1.4

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
2002年12月23日 21:41:29 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv4868/python/Doc/lib
Modified Files:
	libdatetime.tex 
Log Message:
Implemented .replace() methods for date, datetime, datetimetz, time and
timetz.
Index: libdatetime.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdatetime.tex,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** libdatetime.tex	23 Dec 2002 22:21:52 -0000	1.3
--- libdatetime.tex	24 Dec 2002 05:41:26 -0000	1.4
***************
*** 366,369 ****
--- 366,375 ----
 Instance methods:
 
+ - replace(year=, month=, day=)
+ Return a date with the same value, except for those fields given
+ new values by whichever keyword arguments are specified. For
+ example, if \code{d == date(2002, 12, 31)}, then
+ \code{d.replace(day=26) == date(2000, 12, 26)}.
+ 
 - timetuple()
 Return a 9-element tuple of the form returned by
***************
*** 592,595 ****
--- 598,605 ----
 Return time object with same hour, minute, second and microsecond.
 
+ - replace(year=, month=, day=, hour=, minute=, second=, microsecond=)
+ Return a datetime with the same value, except for those fields given
+ new values by whichever keyword arguments are specified.
+ 
 - timetuple()
 Return a 9-element tuple of the form returned by
***************
*** 711,714 ****
--- 721,728 ----
 Instance methods:
 
+ - replace(hour=, minute=, second=, microsecond=)
+ Return a time with the same value, except for those fields given
+ new values by whichever keyword arguments are specified.
+ 
 - isoformat()
 Return a string representing the time in ISO 8601 format,
***************
*** 858,861 ****
--- 872,881 ----
 Instance methods:
 
+ - replace(hour=, minute=, second=, microsecond=, tzinfo=)
+ Return a timetz with the same value, except for those fields given
+ new values by whichever keyword arguments are specified. Note that
+ \code{tzinfo=None} can be specified to create a naive timetz from an
+ aware timetz.
+ 
 - isoformat()
 Return a string representing the time in ISO 8601 format,
***************
*** 1049,1057 ****
 and tzinfo.
 
 - utcoffset()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
 \code{tzinfo.utcoffset(self)}.
 
! - tzname():
 If \member{tzinfo} is \code{None}, returns \code{None}, else
 \code{tzinfo.tzname(self)}.
--- 1069,1084 ----
 and tzinfo.
 
+ - replace(year=, month=, day=, hour=, minute=, second=, microsecond=,
+ tzinfo=)
+ Return a datetimetz with the same value, except for those fields given
+ new values by whichever keyword arguments are specified. Note that
+ \code{tzinfo=None} can be specified to create a naive datetimetz from
+ an aware datetimetz.
+ 
 - utcoffset()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
 \code{tzinfo.utcoffset(self)}.
 
! - tzname()
 If \member{tzinfo} is \code{None}, returns \code{None}, else
 \code{tzinfo.tzname(self)}.

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