@@ -16,7 +16,7 @@ \section{\module{datetime} ---
1616The \module {datetime} module supplies classes for manipulating dates
1717and times in both simple and complex ways. While date and time
1818arithmetic is supported, the focus of the implementation is on
19- efficient member extraction, for output formatting and manipulation.
19+ efficient member extraction for output formatting and manipulation.
2020
2121There are two kinds of date and time objects: `` naive'' and `` aware'' .
2222This distinction refers to whether the object has any notion of time
@@ -28,15 +28,17 @@ \section{\module{datetime} ---
2828\class {datetime} objects are easy to understand and to work with, at
2929the cost of ignoring some aspects of reality.
3030
31- For applications requiring more, \class {datetime} and \class {time} objects
32- have an optional time zone information member.
33- These \class {tzinfo} objects capture information about the offset from
34- UTC time, the time zone name, and whether Daylight Saving Time is in
35- effect. Note that no concrete \class {tzinfo} classes are supplied by
36- the \module {datetime} module. Instead, they provide a framework for
37- incorporating the level of detail an app may require. The rules for
38- time adjustment across the world are more political than rational, and
39- there is no standard suitable for every app.
31+ For applications requiring more, \class {datetime} and \class {time}
32+ objects have an optional time zone information member,
33+ \member {tzinfo}, that can contain an instance of a subclass of
34+ the abstract \class {tzinfo} class. These \class {tzinfo} objects
35+ capture information about the offset from UTC time, the time zone
36+ name, and whether Daylight Saving Time is in effect. Note that no
37+ concrete \class {tzinfo} classes are supplied by the \module {datetime}
38+ module. Instead, they provide a framework for incorporating the level
39+ of detail an application may require. The rules for time adjustment across
40+ the world are more political than rational, and there is no standard
41+ suitable for every application.
4042
4143The \module {datetime} module exports the following constants:
4244
@@ -73,22 +75,22 @@ \subsection{Available Types}
7375\end {classdesc* }
7476
7577\begin {classdesc* }{datetime}
76- A combination of a naive date and a time.
78+ A combination of a date and a time.
7779 Attributes: \member {year}, \member {month}, \member {day},
7880 \member {hour}, \member {minute}, \member {second},
7981 \member {microsecond}, and \member {tzinfo}.
8082\end {classdesc* }
8183
8284\begin {classdesc* }{timedelta}
83- A duration, expressing the difference between two \class {date},
84- \class {time}, or \class {datetime} instances, to microsecond
85+ A duration expressing the difference between two \class {date},
86+ \class {time}, or \class {datetime} instances to microsecond
8587 resolution.
8688\end {classdesc* }
8789
8890\begin {classdesc* }{tzinfo}
8991 An abstract base class for time zone information objects. These
9092 are used by the \class {datetime} and \class {time} classes to
91- provided a customizable notion of time adjustment (for example, to
93+ provide a customizable notion of time adjustment (for example, to
9294 account for time zone and/or daylight saving time).
9395\end {classdesc* }
9496
@@ -98,7 +100,7 @@ \subsection{Available Types}
98100
99101An object \var {d} of type \class {time} or \class {datetime} may be
100102naive or aware. \var {d} is aware if \code {\var {d}.tzinfo} is not
101- \code {None}, and \code {\var {d}.tzinfo.utcoffset(\var {d})} does not return
103+ \code {None} and \code {\var {d}.tzinfo.utcoffset(\var {d})} does not return
102104\code {None}. If \code {\var {d}.tzinfo} is \code {None}, or if
103105\code {\var {d}.tzinfo} is not \code {None} but
104106\code {\var {d}.tzinfo.utcoffset(\var {d})} returns \code {None}, \var {d}
@@ -132,12 +134,12 @@ \subsection{\class{timedelta} Objects \label{datetime-timedelta}}
132134 Only \var {days}, \var {seconds} and \var {microseconds} are stored
133135 internally. Arguments are converted to those units:
134136
135- \begin {verbatim }
136- A millisecond is converted to 1000 microseconds.
137- A minute is converted to 60 seconds.
138- An hour is converted to 3600 seconds.
139- A week is converted to 7 days.
140- \end {verbatim }
137+ \begin {itemize }
138+ \item A millisecond is converted to 1000 microseconds.
139+ \item A minute is converted to 60 seconds.
140+ \item An hour is converted to 3600 seconds.
141+ \item A week is converted to 7 days.
142+ \end {itemize }
141143
142144 and days, seconds and microseconds are then normalized so that the
143145 representation is unique, with
@@ -148,7 +150,7 @@ \subsection{\class{timedelta} Objects \label{datetime-timedelta}}
148150 \item \code {-999999999 <= \var {days} <= 999999999}
149151\end {itemize }
150152
151- If any argument is a float, and there are fractional microseconds,
153+ If any argument is a float and there are fractional microseconds,
152154 the fractional microseconds left over from all arguments are combined
153155 and their sum is rounded to the nearest microsecond. If no
154156 argument is a float, the conversion and normalization processes
@@ -199,6 +201,7 @@ \subsection{\class{timedelta} Objects \label{datetime-timedelta}}
199201
200202Supported operations:
201203
204+ % XXX this table is too wide!
202205\begin {tableiii }{c|l|c}{code}{Operation}{Result}{Notes}
203206 \lineiii {\var {t1} = \var {t2} + \var {t3}}
204207 {Sum of \var {t2} and \var {t3}.
@@ -224,12 +227,11 @@ \subsection{\class{timedelta} Objects \label{datetime-timedelta}}
224227 {(2)}
225228 \lineiii {-\var {t1}}
226229 {equivalent to \class {timedelta}(-\var {t1.days}, -\var {t1.seconds},
227- -\var {t1.microseconds}),and to \var {t1}* -1.}
230+ -\var {t1.microseconds}), and to \var {t1}* -1.}
228231 {(1)(4)}
229232 \lineiii {abs(\var {t})}
230233 {equivalent to +\var {t} when \code {t.days >= 0}, and to
231- -\var {t} when \code {t.days < 0}.
232- overflow.}
234+ -\var {t} when \code {t.days < 0}.}
233235 {(2)}
234236\end {tableiii }
235237\noindent
@@ -257,7 +259,7 @@ \subsection{\class{timedelta} Objects \label{datetime-timedelta}}
257259\class {timedelta} object representing the smaller duration considered
258260to be the smaller timedelta.
259261
260- \class {timedelta} objects are hashable (usable as dictionary key ),
262+ \class {timedelta} objects are hashable (usable as dictionary keys ),
261263support efficient pickling, and in Boolean contexts, a \class {timedelta}
262264object is considered to be true if and only if it isn't equal to
263265\code {timedelta(0)}.
@@ -332,7 +334,7 @@ \subsection{\class{date} Objects \label{datetime-date}}
332334Instance attributes (read-only):
333335
334336\begin {memberdesc }{year}
335- Between \constant {MINYEAR} and \constant {MAXYEAR} inclusive
337+ Between \constant {MINYEAR} and \constant {MAXYEAR} inclusive.
336338\end {memberdesc }
337339
338340\begin {memberdesc }{month}
@@ -346,6 +348,7 @@ \subsection{\class{date} Objects \label{datetime-date}}
346348
347349Supported operations:
348350
351+ % XXX rewrite to be a table
349352\begin {itemize }
350353 \item
351354 date1 + timedelta -> date2
0 commit comments