Fix grammar, whitespace, and a couple of semantic mistakes (#16818).
This commit is contained in:
parent
924049ca71
commit
6da2f88af0
21
pep-0431.txt
21
pep-0431.txt
|
@ -49,14 +49,14 @@ for example Windows, a distribution containing the latest tz database should
|
|||
also be available at the Python Package Index, so it can be easily installed
|
||||
with the Python packaging tools such as ``easy_install`` or ``pip``. This
|
||||
could also be done on Unices that are no longer receiving updates and
|
||||
therefore has an outdated database.
|
||||
therefore have an outdated database.
|
||||
|
||||
With such a mechanism Python would have full time zone support in the
|
||||
standard library on most platforms, and a simple package installation would
|
||||
provide time zone support on those platforms where the tz database isn't
|
||||
included, such as Windows.
|
||||
|
||||
The time zone support will be implemented by a new module called `timezone``,
|
||||
The time zone support will be implemented by a new module called ``timezone``,
|
||||
based on Stuart Bishop's ``pytz`` module.
|
||||
|
||||
|
||||
|
@ -82,12 +82,12 @@ The support for this will be made by integrating Lennart Regebro's
|
|||
Ambiguous times
|
||||
---------------
|
||||
|
||||
When changing over from daylight savings time the clock is turned back one
|
||||
When changing over from daylight savings time (DST) the clock is turned back one
|
||||
hour. This means that the times during that hour happens twice, once without
|
||||
DST and then once with DST. Similarly, when changing to daylight savings
|
||||
time, one hour goes missing.
|
||||
|
||||
The current time zone API can not differentiating between the two ambiguous
|
||||
The current time zone API can not differentiate between the two ambiguous
|
||||
times during a change from DST. For example, in Stockholm the time of
|
||||
2012-11-28 02:00:00 happens twice, both at UTC 2012-11-28 00:00:00 and also
|
||||
at 2012-11-28 01:00:00.
|
||||
|
@ -131,7 +131,7 @@ function and one new exception.
|
|||
This function takes a name string that must be a string specifying a
|
||||
valid zoneinfo timezone, i.e. "US/Eastern", "Europe/Warsaw" or "Etc/GMT+11".
|
||||
If not given, the local timezone will be looked up. If an invalid zone name
|
||||
are given, or the local timezone can not be retrieved, the function raises
|
||||
is given, or the local timezone can not be retrieved, the function raises
|
||||
`UnknownTimeZoneError`.
|
||||
|
||||
The function also takes an optional path to the location of the zoneinfo
|
||||
|
@ -143,6 +143,7 @@ function and one new exception.
|
|||
be raised with a message explaining that no zoneinfo database can be found,
|
||||
but that you can install one with the ``timezonedata`` package.
|
||||
|
||||
|
||||
* New Exception: ``UnknownTimeZoneError``
|
||||
|
||||
This exception is raised when giving a time zone specification that can't be
|
||||
|
@ -184,7 +185,7 @@ There are also two new exceptions:
|
|||
|
||||
* ``AmbiguousTimeError``
|
||||
|
||||
This exception is raised when giving a datetime specification that are
|
||||
This exception is raised when giving a datetime specification that is
|
||||
ambiguous while setting ``is_dst`` to None::
|
||||
|
||||
>>> datetime(2012, 11, 28, 2, 0, tzinfo=timezone('Europe/Stockholm'), is_dst=None)
|
||||
|
@ -196,8 +197,8 @@ There are also two new exceptions:
|
|||
|
||||
* ``NonExistentTimeError``
|
||||
|
||||
This exception is raised when giving a datetime specification that are
|
||||
ambiguous while setting ``is_dst`` to None::
|
||||
This exception is raised when giving a datetime specification that is
|
||||
non-existent while setting ``is_dst`` to None::
|
||||
|
||||
>>> datetime(2012, 3, 25, 2, 0, tzinfo=timezone('Europe/Stockholm'), is_dst=None)
|
||||
>>>
|
||||
|
@ -226,7 +227,7 @@ Differences from the ``pytz`` API
|
|||
clarity.
|
||||
|
||||
* ``get_timezone()`` will return the local time zone if called without
|
||||
parameters.
|
||||
arguments.
|
||||
|
||||
* The class ``pytz.StaticTzInfo`` is there to provide the ``is_dst`` support
|
||||
for static timezones. When ``is_dst`` support is included in
|
||||
|
@ -240,7 +241,7 @@ Should the windows installer include the data package?
|
|||
------------------------------------------------------
|
||||
|
||||
It has been suggested that the Windows installer should include the data
|
||||
package. This would mean that an explicit installation no longer would be
|
||||
package. This would mean that an explicit installation would no longer be
|
||||
needed on Windows. On the other hand, that would mean that many using Windows
|
||||
would not be aware that the database quickly becomes outdated and would not
|
||||
keep it updated.
|
||||
|
|
Loading…
Reference in New Issue