[Python-Dev] cpython (3.2): #14766: Add correct algorithm for when a 'time' object is naive.

Georg Brandl g.brandl at gmx.net
Mon May 21 19:46:59 CEST 2012


Am 15.05.2012 04:33, schrieb r.david.murray:

> diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
> --- a/Doc/library/datetime.rst
> +++ b/Doc/library/datetime.rst
> @@ -15,16 +15,23 @@
>  formatting and manipulation. For related
>  functionality, see also the :mod:`time` and :mod:`calendar` modules.
>  
> -There are two kinds of date and time objects: "naive" and "aware". This
> -distinction refers to whether the object has any notion of time zone, daylight
> -saving time, or other kind of algorithmic or political time adjustment.  Whether
> -a naive :class:`.datetime` object represents Coordinated Universal Time (UTC),
> +There are two kinds of date and time objects: "naive" and "aware".
> +
> +An aware object has sufficient knowledge of applicable algorithmic and
> +political time adjustments, such as time zone and daylight saving time
> +information, to locate itself relative to other aware objects.  An aware object
> +is used to represent a specific moment in time that is not open to
> +interpretation [#]_.

> @@ -1806,3 +1816,7 @@
>     When the ``%z`` directive is provided to the :meth:`strptime` method, an
>     aware :class:`.datetime` object will be produced.  The ``tzinfo`` of the
>     result will be set to a :class:`timezone` instance.
> +
> +.. rubric:: Footnotes
> +
> +.. [#] If, that is, we ignore the effects of Relativity

I like that :)

Georg



More information about the Python-Dev mailing list