Re: [Python-Dev] Aware datetime from naive local time Was: Status on PEP-431 Timezones

2015-04-17 Thread Akira Li
On Thu, Apr 16, 2015 at 1:14 AM, Alexander Belopolsky < alexander.belopol...@gmail.com> wrote: > > On Wed, Apr 15, 2015 at 4:46 PM, Akira Li <4kir4...@gmail.com> wrote: > >> > Look what happened on July 1, 1990. At 2 AM, the clocks in Ukraine were >> > mo

Re: [Python-Dev] Status on PEP-431 Timezones

2015-04-15 Thread Akira Li
Isaac Schwabacher writes: > On 15-04-15, Akira Li <4kir4...@gmail.com> wrote: >> Isaac Schwabacher writes: >> > ... >> > >> > I know that you can do datetime.now(tz), and you can do datetime(2013, >> > 11, 3, 1, 30, tzinfo=zoneinfo('Americ

Re: [Python-Dev] Aware datetime from naive local time Was: Status on PEP-431 Timezones

2015-04-15 Thread Akira Li
Alexander Belopolsky writes: > ... > For most world locations past discontinuities are fairly well documented > for at least a century and future changes are published with at least 6 > months lead time. It is important to note that the different versions of the tz database may lead to different

Re: [Python-Dev] Aware datetime from naive local time Was: Status on PEP-431 Timezones

2015-04-15 Thread Akira Li
Alexander Belopolsky writes: > Sorry for a truncated message. Please scroll past the quoted portion. > > On Thu, Apr 9, 2015 at 10:21 PM, Alexander Belopolsky < > alexander.belopol...@gmail.com> wrote: > >> >> On Thu, Apr 9, 2015 at 4:51 PM, Isaac Schwabacher >> wrote: >> >>> > > > Well, you ar

Re: [Python-Dev] Status on PEP-431 Timezones

2015-04-15 Thread Akira Li
Isaac Schwabacher writes: > ... > > I know that you can do datetime.now(tz), and you can do datetime(2013, > 11, 3, 1, 30, tzinfo=zoneinfo('America/Chicago')), but not being able > to add a time zone to an existing naive datetime is painful (and > strptime doesn't even let you pass in a time zone)

Re: [Python-Dev] Status on PEP-431 Timezones

2015-04-15 Thread Akira Li
Lennart Regebro writes: > OK, so I realized another thing today, and that is that arithmetic > doesn't necessarily round trip. > > For example, 2002-10-27 01:00 US/Eastern comes both in DST and STD. > > But 2002-10-27 01:00 US/Eastern STD minus two days is 2002-10-25 01:00 > US/Eastern DST "two

Re: [Python-Dev] Status on PEP-431 Timezones

2015-04-15 Thread Akira Li
Alexander Belopolsky writes: > On Wed, Apr 8, 2015 at 3:57 PM, Isaac Schwabacher > wrote: >> >> On 15-04-08, Alexander Belopolsky wrote: >> > With datetime, we also have a problem that POSIX APIs don't have to > deal with: local time >> > arithmetics. What is t + timedelta(1) when t falls on the

Re: [Python-Dev] PEP 481 - Migrate Some Supporting Repositories to Git and Github

2014-11-30 Thread Akira Li
ould use bookmarks with hg http://lostechies.com/jimmybogard/2010/06/03/translating-my-git-workflow-with-local-branches-to-mercurial/ http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/#branching-with-bookmarks http://mercurial.selenic.com/wiki/BookmarksExtensi

Re: [Python-Dev] Multilingual programming article on the Red Hat Developer blog

2014-09-16 Thread Akira Li
n!”') >>> h.encode('utf-8') '=?utf-8?q?Subject=3A_=E2=80=9CNOBODY_expects_the_Spanish_Inquisition!?=\n =?utf-8?q?=E2=80=9D?=' >>> h.encode() '=?utf-8?q?Subject=3A_=E2=80=9CNOBODY_expects_the_Spanish_Inquisition!?=\n =?utf-8?q?=E2=80=9D?='

Re: [Python-Dev] Multiline with statement line continuation

2014-08-13 Thread Akira Li
e) #XXX unnecessary function And (nested() can be implemented using ExitStack): with nested(open(..), open(..)) as (input_file, output_file): ... #XXX less readable Here's an example where nested() won't help: def get_integers(filename): with (open(file

Re: [Python-Dev] os.walk() is going to be *fast* with scandir

2014-08-11 Thread Akira Li
ports_dir_fd)). Victor Stinner suggested [1] to allow scandir(fd) but I don't see it being mentioned in the pep 471 [2]: it neither supports nor rejects the idea. [1] https://mail.python.org/pipermail/python-dev/2014-July/135283.html [2] http:

Re: [Python-Dev] python2.7 infinite recursion when loading pickled object

2014-08-11 Thread Akira Li
27;), name) There were issues in the past due to {get,has}attr silencing non-AttributeError exceptions; therefore it is good that pickle breaks when it gets RuntimeError instead of AttributeError. -- Akira ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] Exposing the Android platform existence to Python modules

2014-08-03 Thread Akira Li
ck the test suite again. FYI, /bin/sh is not POSIX, see http://bugs.python.org/issue16353#msg224514 -- Akira ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Exposing the Android platform existence to Python modules

2014-08-03 Thread Akira Li
n the discussion (maybe for a reason). It might provide build-time information e.g., built_for_android = 'android' in sysconfig.get_config_var('MULTIARCH') assuming the complete value is something like 'arm-linux-android'. It says that the python binary is built f

Re: [Python-Dev] Exposing the Android platform existence to Python modules

2014-08-01 Thread Akira Li
en.wikipedia.org/wiki/Android_(operating_system) btw, does it help adding os.get_shell_executable() [5] function, to avoid hacking subprocess module, so that os.confstr('CS_PATH') or os.defpath on Android could be defined to include /system/bin instead? [5] http://bugs.python.org/issue16353 -- Akira ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 471 "scandir" accepted

2014-07-22 Thread Akira Li
alk() in terms of it. Would scandir() provide the same performance benefits as for os.walk()? entry.stat() can be implemented without entry.path when entry._directory (or whatever other DirEntry's attribute that stores the first parameter to os.scandir(fd)) is an open file descriptor that refers to a directo

Re: [Python-Dev] PEP 471 "scandir" accepted

2014-07-22 Thread Akira Li
a directory. [3] https://docs.python.org/3.4/library/os.html#os.listdir [4] http://hg.python.org/cpython/file/3.4/Modules/posixmodule.c#l3736 -- Akira ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-d

Re: [Python-Dev] Remaining decisions on PEP 471 -- os.scandir()

2014-07-14 Thread Akira Li
sistent with coreutils commands such as `cp` that follows symlinks for non-recursive actions but e.g., `du` utility that is inherently recursive doesn't follow symlinks by default. follow_symlinks=True as default for DirEntry.is_dir method allows to avoid easy-to-introduce bugs while replacing old

Re: [Python-Dev] == on object tests identity in 3.x - list delegation to members?

2014-07-13 Thread Akira Li
python.org/issue21873 but it was closed as "not a bug" despite the corresponding behavior is *not documented* anywhere. -- Akira ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Updates to PEP 471, the os.scandir() proposal

2014-07-09 Thread Akira Li
ated using:: entries = sorted(filter(sel, os.scandir(path)), key=cmp_to_key(compar)) so that the above code snippet could be provided in the docs. We may say that os.scandir is a pythonic analog of the POSIX function and therefore there is no conflict even if os.scandir doesn

Re: [Python-Dev] PEP 471: scandir(fd) and pathlib.Path(name, dir_fd=None)

2014-07-01 Thread Akira Li
pports_dir_fd are different sets. See also, https://mail.python.org/pipermail/python-dev/2014-June/135265.html -- Akira P.S. Please, don't put your answer on top of the message you are replying to. > > On Tue, Jul 1, 2014 at 3:44 AM, Victor Stinner > wrote: >> Hi, >> >

Re: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator

2014-06-29 Thread Akira Li
Chris Angelico writes: > On Sat, Jun 28, 2014 at 11:05 PM, Akira Li <4kir4...@gmail.com> wrote: >> Have you considered adding support for paths relative to directory >> descriptors [1] via keyword only dir_fd=None parameter if it may lead to >> more efficient implem

Re: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator

2014-06-28 Thread Akira Li
scandir(path='.') -> generator of DirEntry objects > Have you considered adding support for paths relative to directory descriptors [1] via keyword only dir_fd=None parameter if it may lead to more efficient implementations on some platforms? [1]

Re: [Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

2014-06-13 Thread Akira Li
llows Microsoft C/C++ startup code rules [3] e.g., `^` is not special unlike in cmd.exe case). [1]: http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx [2]: https://docs.python.org/3.4/library/subprocess.html#converting-an-argument-s

Re: [Python-Dev] should tests be thread-safe?

2014-05-11 Thread Akira Li
;hidden" C thread for the Tk loop. Does it mean that non-thread-safe tests can't be run using a GUI test runner that is implemented using tkinter? -- akira ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/list

[Python-Dev] should tests be thread-safe?

2014-05-09 Thread akira
at is known to be non-thread-safe. Is it acceptable for new tests? -- akira ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%4

[Python-Dev] Fwd: distutils doesn't use some compiler options when building

2008-11-26 Thread Akira Kitada
I didn't know distutils has its own list. Forwarding. -- Forwarded message -- From: Akira Kitada Date: Thu, Nov 27, 2008 at 2:28 AM Subject: distutils doesn't use some compiler options when building To: python-dev@python.org Hi, I encountered a weird problem using

[Python-Dev] distutils doesn't use some compiler options when building

2008-11-26 Thread Akira Kitada
Hi, I encountered a weird problem using distutils. Generally, distutils try to use the same compiler options used for building Python interpreter, but it looks like some of them are omitted sometimes. - CPPFLAGS are not retrieved from the config and only ones in env are used. - OPT is retrieved f