Re: [Python-ideas] Top 10 Python modules that need a redesign Was: Geo coordinates conversion in stdlib

On Sun, Apr 5, 2015, at 00:00, Steven D'Aprano wrote:
As I understand it, the list of codes accepted is platform-dependent. While many codes are standard from machine to machine, some are not available on some systems.
In my opinion all codes accepted by C11 *should* be supported by python; its present failure to do so is a wart. Any new work to address this issue should be in the form of a pure python strftime function rather than an effort to document every platform's idiosyncracies.
In particular, none of the specifiers in the standard _except_ %z or %Z require any platform-specific logic. And these could be addressed by likewise supporting tm_zone and tm_gmtoff on platforms that do not provide them.

On Mon, Apr 6, 2015 at 4:58 PM, random832@fastmail.us wrote:
In my opinion all codes accepted by C11 *should* be supported by python; its present failure to do so is a wart. Any new work to address this issue should be in the form of a pure python strftime function rather than an effort to document every platform's idiosyncracies.
An issue [1] to implement that was open almost 7 years ago and seen little progress since then. The problem is that there is no reliable cross-platform method to access locale information that stftime needs. One could try to do something with nl_langinfo(), but that is a pre-Unicode interface that assumes one global locale, so modern platforms have extended it in various incompatible ways. Note that strftime itself assumes one global locale and that's another reason to switch to something more modern.

On 06/04/2015 21:58, random832@fastmail.us wrote:
On Sun, Apr 5, 2015, at 00:00, Steven D'Aprano wrote:
As I understand it, the list of codes accepted is platform-dependent. While many codes are standard from machine to machine, some are not available on some systems.
In my opinion all codes accepted by C11 *should* be supported by python; its present failure to do so is a wart. Any new work to address this issue should be in the form of a pure python strftime function rather than an effort to document every platform's idiosyncracies.
In particular, none of the specifiers in the standard _except_ %z or %Z require any platform-specific logic. And these could be addressed by likewise supporting tm_zone and tm_gmtoff on platforms that do not provide them.
Patches are always welcome. Will *YOU* be providing more patches than the originator of this thread?
participants (3)
-
Alexander Belopolsky
-
Mark Lawrence
-
random832@fastmail.us