Why is it True by default? Do we have statistics showing that Python
gets more use in summer?
Regards
Antoine.
On Dec 11, 2012, at 04:23 PM, Lennart Regebro wrote:
wget returns some html gobbledygook. Why-oh-why github?!'
PEP: 4??I've assigned this PEP 431, reformatted a few extra wide paragraphs, committedand pushed.Thanks Lennart!-Barry
_______________________________________________Python-Dev mailing list
_______________________________________________
Python-Dev mailing list
Pytho...@python.org
http://mail.python.org/mailman/listinfo/python-dev
Abstract
========
This PEP proposes the implementation of concrete time zone support in the
Python standard library, and also improvements to the time zone API to deal
with ambiguous time specifications during DST changes.
Proposal
========
Concrete time zone support
--------------------------
The time zone support in Python has no concrete implementation in the
standard library, only a tzinfo baseclass, and since Python 3.2, one concrete
time zone: UTC.
The time zone support will be implemented by a new module called `timezone``,
based on Stuart Bishop's ``pytz`` module.
This PEP proposes to add these ``is_dst`` parameters to the relevant methods
of the ``datetime`` API, and therefore add this functionality directly to
``datetime``. This is likely the hardest part of this PEP as this
involves updating
the
The ``timezonedata``-package
-----------------------------
The zoneinfo database will be packaged for easy installation with
``easy_install``/``pip``/``buildout``. This package will not install any
Python code, and will not contain any Python code except that which is needed
for installation.
I don't get why people are so obsessed about updating the timezone
database. Really, this is not worse than having a vulnerable OpenSSL
linked with your Python executable. Purity does not bring any
advantage here.
Regards
Antoine.
Le 12/12/2012 04:53, Christian Heimes a écrit :
> Am 12.12.2012 01:58, schrieb Nick Coghlan:
>> Ick, why a new module? Why not just add this directly to datetime? (It
>> doesn't need to be provided by the C accelerator, it can go straight in
>> the pure Python part).
>
> +1 for something like datetime.timezone
>
> How well does hg handle files renames? The datetime module could be
> converted to a package.
Quite well. It’s easy to rename datetime.py to datetime/__init__py, and
subsequent fixes in 3.3’s datetime.py will be merged into
datetime/__init__.py by Mercurial’s merge subsystem.
Cheers
I see an issue here that makes me a little uncomfortable:
Having a default that makes code work all year but raises an error during
the "impossible hour" could be problematic in critical code.
Can we make this more explicit by forcing the users to decide?
I like the idea of the extra boolean flag here, because it will be
explicitly
visible that this code intentionally creates an exception.
Or even not a flag, but the exception to be raised, or a callable to
handle this case?
Sloppy coding can be dangerous. So maybe the warning module could be
helpful as well: If None is passed and no explicit flag/exception/callable
given, bother the user with a warning message ;-)
cheers - chris
--
Christian Tismer :^)<mailto:tis...@stackless.com>
Software Consulting : Have a break! Take a ride on Python's
Karl-Liebknecht-Str. 121 : *Starship*http://starship.python.net/
14482 Potsdam : PGP key ->http://pgp.uni-mainz.de
phone +49 173 24 18 776 fax +49 (30) 700143-0023
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today?http://www.stackless.com/
On Dec 12, 2012 7:24 PM, "Terry Reedy" <tjr...@udel.edu> wrote:
>
> On 12/12/2012 7:27 PM, Brian Curtin wrote:
>>
>> On Wed, Dec 12, 2012 at 6:10 PM, MRAB <pyt...@mrabarnett.plus.com> wrote:
>>>
>>> On 2012-12-12 23:33, Lennart Regebro wrote:
>>>>
>>>>
>>>> On Thu, Dec 13, 2012 at 12:23 AM, Terry Reedy <tjr...@udel.edu> wrote:
>>>>>
>>>>>
>>>>> As a Windows user, I would like there to be one tz data file used by all
>>>>> Python versions on my machine, including ones included with other apps.
>>>>
>>>>
>>>>
>>>> That would be nice, but where would that be installed? There is no
>>>> standard location for zoneinfo files. And do we really want to install
>>>> python-specific files outside the Python tree?
>
>
> There is no 'Python tree' on windows. Rather, there is a separate tree for each version, located where the user directs.
>
> Windows used to have a %APPDATA% directory variable. Not sure about Win 7, let alone 8. Martin and others should know better.
>
> Or ask the user where to put it. I know where I would choose, and it would not be on my C drive. Un-installers would not delete (unless a reference count were kept and were decremented to 0).
>
>
>>> Python version x.y is installed into, say, C:\Pythonxy, so perhaps a
>>> good place would be, say, C:\Python.
>>
>>
>> C:\ProgramData\Python
>
>
> Making a new top-level directory without asking is obnoxious.
See http://stackoverflow.com/questions/9518890/what-is-the-significance-programdata-in-windows
>> C:\ProgramData\Python
On 12/12/2012 8:43 PM, Glenn Linderman wrote:
On 12/12/2012 5:36 PM, Brian Curtin wrote:
>> C:\ProgramData\Python
^^^^^ That. Is not the path that the link below is talking
about, though.
It actually does; it is rather confusing though. :/
Agreed. This doesn't warrant special-casing.
Regards
Antoine.
> On 12/12/2012 10:56 AM, Lennart Regebro wrote:
>
> >> It seems like calling get_timezone() with an unknown timezone
> >> should just throw ValueError, not necessarily some custom
> >> Exception?
> >
> > That could very well be. What are others opinions on this?
>
> ValueError. That is what it is. Nothing special here.
I think it's useful to have this raise a custom exception
UnknownTimeZoneError, subclassed from ValueError. That satisfies those
(including me!) who think it should be a ValueError, while also making
the exception more specific so it can be handled apart from other
possible ValueError causes.
In short: +1 to ‘class UnknownTimeZoneError(ValueError)’.
--
\ “Members of the general public commonly find copyright rules |
`\ implausible, and simply disbelieve them.” —Jessica Litman, |
_o__) _Digital Copyright_ |
Ben Finney
That would be `class UnknownTimeZoneError(ValueError, TimeZoneError)`.
The PEP says:
* New function :``timezone(name=None, db_path=None)``It isn't 100% clear to me from the PEP what a valid name string would be,
This function takes a name string that must be a string specifying a
valid zoneinfo timezone, ie "US/Eastern", "Europe/Warsaw" or "Etc/GMT+11".
but I assume that it will accept anything that the time.tzset function
will accept:
(We have KeyError rather than UnknownKeyError, NameError rather than
UnknownNameError, etc.)
If I've understood it correctly, that contradicts the PEP. One examplegiven is "Etc/GMT+11", which is not a timezone *name*, but a timezone
name *plus an offset*. Presumably if GMT+11 is legal, so should be
GMT+10:30.
There is no "Etc/GMT+11" named here:
http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
nor is it included in /usr/share/zoneinfo/zone.tab in either of the systems
I looked at (one Debian, one Centos), but there is Etc/GMT. So I conclude
that the PEP allows timezone rules, not just names.
Either way, I think the PEP needs to clarify what counts as a valid name
string.
Perhaps the database is out-of-date, or the government has suddenly declared
a daylight savings change that isn't reflected yet in the database. Or you
want to set your own TZ rules for testing. Or you've just declared independence
from the central government and are setting up your own TZ rules.
time.tzset supports rules as well as names. Is there some reason why this
module should not do the same?