diff options
author | Georg Brandl <georg@python.org> | 2006-09-30 09:06:49 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-09-30 09:06:49 +0000 |
commit | ad4e11e16d6ece17980e59a3b6474d0a186ffb56 (patch) | |
tree | fe6986d94666414c3617d4c685be7ed0c6b97d77 | |
parent | 506cc189a97a468180ee18e4c4cd1b4e81242222 (diff) | |
download | cpython-git-ad4e11e16d6ece17980e59a3b6474d0a186ffb56.tar.gz |
Bug #1566663: remove obsolete example from datetime docs.
(backport from rev. 52063)
-rw-r--r-- | Doc/lib/libdatetime.tex | 34 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
2 files changed, 20 insertions, 16 deletions
diff --git a/Doc/lib/libdatetime.tex b/Doc/lib/libdatetime.tex index cae5d60dc9..0d2b5bb643 100644 --- a/Doc/lib/libdatetime.tex +++ b/Doc/lib/libdatetime.tex @@ -1421,19 +1421,21 @@ The exact range of years for which \method{strftime()} works also varies across platforms. Regardless of platform, years before 1900 cannot be used. -\subsection{Examples} - -\subsubsection{Creating Datetime Objects from Formatted Strings} - -The \class{datetime} class does not directly support parsing formatted time -strings. You can use \function{time.strptime} to do the parsing and create -a \class{datetime} object from the tuple it returns: - -\begin{verbatim} ->>> s = "2005-12-06T12:13:14" ->>> from datetime import datetime ->>> from time import strptime ->>> datetime(*strptime(s, "%Y-%m-%dT%H:%M:%S")[0:6]) -datetime.datetime(2005, 12, 6, 12, 13, 14) -\end{verbatim} - +%%% This example is obsolete, since strptime is now supported by datetime. +% +% \subsection{Examples} +% +% \subsubsection{Creating Datetime Objects from Formatted Strings} +% +% The \class{datetime} class does not directly support parsing formatted time +% strings. You can use \function{time.strptime} to do the parsing and create +% a \class{datetime} object from the tuple it returns: +% +% \begin{verbatim} +% >>> s = "2005-12-06T12:13:14" +% >>> from datetime import datetime +% >>> from time import strptime +% >>> datetime(*strptime(s, "%Y-%m-%dT%H:%M:%S")[0:6]) +% datetime.datetime(2005, 12, 6, 12, 13, 14) +% \end{verbatim} +% @@ -151,6 +151,8 @@ Tests Documentation ------------- +- Bug #1566663: remove obsolete example from datetime docs. + - Bug #1541682: Fix example in the "Refcount details" API docs. Additionally, remove a faulty example showing PySequence_SetItem applied to a newly created list object and add notes that this isn't a good idea. |