Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Glenn Linderman
On 10/14/2013 5:18 PM, Nick Coghlan wrote: What the new CM *doesn't* handle nicely is multi-statement suites, and I'm OK with that. Yeah, that is the dubious part. You can't even convince python-dev that saving 2 lines to ignore an exception in one line of code is a good idea, at the cost of

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Charles Hixson
On 10/14/2013 06:04 PM, Zero Piraeus wrote: : On Tue, Oct 15, 2013 at 10:18:56AM +1000, Nick Coghlan wrote: I didn't articulate the point very well. The reason I originally approved the change (and the reason I have kept it despite the objections raised) is because it allows correct-but-ugly co

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Zero Piraeus
: On Tue, Oct 15, 2013 at 10:18:56AM +1000, Nick Coghlan wrote: > I didn't articulate the point very well. The reason I originally > approved the change (and the reason I have kept it despite the > objections raised) is because it allows correct-but-ugly code like: > > try: > os.unlin

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Alexander Belopolsky
On Mon, Oct 14, 2013 at 8:18 PM, Nick Coghlan wrote: > .. especially by people that expect it to work like VB's "on error resume > next" > rather than by suppressing the exception and resuming execution after the > with statement. "It is practically impossible to teach good programming to studen

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Nick Coghlan
On 14 Oct 2013 09:28, "Glenn Linderman" wrote: > > On 10/12/2013 11:57 PM, Nick Coghlan wrote: >> >> For the record, this thread did prompt me to consider the new construct anew, but on reflection, I still consider it a reasonable addition to contextlib. >> >> It substantially improves the simple

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Nick Coghlan
On 15 Oct 2013 08:54, "Barry Warsaw" wrote: > > On Oct 12, 2013, at 03:27 PM, Raymond Hettinger wrote: > > >The module maintainer (Nick) approved the name change from his original > >preference for ignored(). That should had been the end of it. > > As a general plea, please be sure to record the

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Alexander Belopolsky
On Mon, Oct 14, 2013 at 6:13 PM, Victor Stinner wrote: > I opened an issue proposing exactly the same change, but I didn't provide a > patch. I found this: http://bugs.python.org/issue10614 but it has (seemingly incorrect) patch. Also related: http://bugs.python.org/issue10972 Victor - is an

Re: [Python-Dev] cpython: Rename contextlib.ignored() to contextlib.ignore().

2013-10-14 Thread Barry Warsaw
On Oct 12, 2013, at 03:27 PM, Raymond Hettinger wrote: >The module maintainer (Nick) approved the name change from his original >preference for ignored(). That should had been the end of it. As a general plea, please be sure to record the rationale and decisions in the appropriate place, such as

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Victor Stinner
I opened an issue proposing exactly the same change, but I didn't provide a patch. Thanks for working on the issue. (Sorry I don't know the issue number. Search for "zipfile encoding".) Victor ___ Python-Dev mailing list Python-Dev@python.org https://ma

Re: [Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Antoine Pitrou
Hello, On Tue, 15 Oct 2013 00:55:05 +0400 Sergey Dorofeev wrote: > Hello, > > I'd like to submit patch to support zip archives created on systems that > use non-US codepage (e.g. russian CP866). > Codepage would be specified in additional parameter of ZipFile > constructor, named "codepage".

[Python-Dev] non-US zip archives support in zipfile.py

2013-10-14 Thread Sergey Dorofeev
Hello, I'd like to submit patch to support zip archives created on systems that use non-US codepage (e.g. russian CP866). Codepage would be specified in additional parameter of ZipFile constructor, named "codepage". If it is not specified, old behavior is preserved (use CP437). --- zipfile.py

Re: [Python-Dev] Change PEP 399 import recommendation

2013-10-14 Thread Brett Cannon
On Sun, Oct 13, 2013 at 3:08 PM, Victor Stinner wrote: > Le 13 oct. 2013 10:19, "Stefan Behnel" a écrit : > > > I agree. I find it much easier to read a plain and obvious > > > > try: > >from _cmodule import * > > except ImportError: > >from _pymodule import * > > > > in a

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Maciej Fijalkowski
On Mon, Oct 14, 2013 at 2:42 PM, Antoine Pitrou wrote: > Le Mon, 14 Oct 2013 14:38:44 +0200, > Maciej Fijalkowski a écrit : > >> On Mon, Oct 14, 2013 at 2:34 PM, Antoine Pitrou >> wrote: >> > Le Mon, 14 Oct 2013 14:25:18 +0200, >> > Maciej Fijalkowski a écrit : >> >> On Mon, Oct 14, 2013 at 2:1

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Antoine Pitrou
Le Mon, 14 Oct 2013 14:38:44 +0200, Maciej Fijalkowski a écrit : > On Mon, Oct 14, 2013 at 2:34 PM, Antoine Pitrou > wrote: > > Le Mon, 14 Oct 2013 14:25:18 +0200, > > Maciej Fijalkowski a écrit : > >> On Mon, Oct 14, 2013 at 2:11 PM, "Martin v. Löwis" > >> wrote: > >> > Am 14.10.13 13:49, sch

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Maciej Fijalkowski
On Mon, Oct 14, 2013 at 2:34 PM, Antoine Pitrou wrote: > Le Mon, 14 Oct 2013 14:25:18 +0200, > Maciej Fijalkowski a écrit : >> On Mon, Oct 14, 2013 at 2:11 PM, "Martin v. Löwis" >> wrote: >> > Am 14.10.13 13:49, schrieb Maciej Fijalkowski: >> >> I'm working on an incremental GC for PyPy. How do

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Antoine Pitrou
Le Mon, 14 Oct 2013 14:25:18 +0200, Maciej Fijalkowski a écrit : > On Mon, Oct 14, 2013 at 2:11 PM, "Martin v. Löwis" > wrote: > > Am 14.10.13 13:49, schrieb Maciej Fijalkowski: > >> I'm working on an incremental GC for PyPy. How do I measure GC > >> pauses in CPython? (that is, the circular refe

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Maciej Fijalkowski
On Mon, Oct 14, 2013 at 2:11 PM, "Martin v. Löwis" wrote: > Am 14.10.13 13:49, schrieb Maciej Fijalkowski: >> I'm working on an incremental GC for PyPy. How do I measure GC pauses >> in CPython? (that is, the circular reference searching stuff) > > I would instrument the interpreter. The tricky pa

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Alex Gaynor
Maciej Fijalkowski gmail.com> writes: > > HI > > I'm working on an incremental GC for PyPy. How do I measure GC pauses > in CPython? (that is, the circular reference searching stuff) > > Cheers, > fijal > For what it's worth I threw together some code that might be helpful: http://bpaste.ne

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Martin v. Löwis
Am 14.10.13 13:49, schrieb Maciej Fijalkowski: > I'm working on an incremental GC for PyPy. How do I measure GC pauses > in CPython? (that is, the circular reference searching stuff) I would instrument the interpreter. The tricky part may be to subtract the time for any resulting finalization (and

Re: [Python-Dev] GC pauses in CPython

2013-10-14 Thread Antoine Pitrou
Le Mon, 14 Oct 2013 13:49:34 +0200, Maciej Fijalkowski a écrit : > HI > > I'm working on an incremental GC for PyPy. How do I measure GC pauses > in CPython? (that is, the circular reference searching stuff) timeit gc.collect()? ___ Python-Dev mailin

Re: [Python-Dev] Make str/bytes hash algorithm pluggable?

2013-10-14 Thread Wolfgang Langner
Hi, I have found a link to a speed comparison of hash functions: http://code.google.com/p/xxhash/ Regards, Wolfgang ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.pytho

[Python-Dev] GC pauses in CPython

2013-10-14 Thread Maciej Fijalkowski
HI I'm working on an incremental GC for PyPy. How do I measure GC pauses in CPython? (that is, the circular reference searching stuff) Cheers, fijal ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Un

Re: [Python-Dev] Right place for PBKDF2 wrapper

2013-10-14 Thread Serhiy Storchaka
14.10.13 13:07, Antoine Pitrou написав(ла): Le Mon, 14 Oct 2013 12:47:03 +0300, Serhiy Storchaka a écrit : 13.10.13 13:39, Christian Heimes написав(ла): Am 13.10.2013 08:32, schrieb Nick Coghlan: +1 to hashlib from me (especially since we used that as the best available home for compare_diges

Re: [Python-Dev] Right place for PBKDF2 wrapper

2013-10-14 Thread Antoine Pitrou
Le Mon, 14 Oct 2013 12:47:03 +0300, Serhiy Storchaka a écrit : > 13.10.13 13:39, Christian Heimes написав(ла): > > Am 13.10.2013 08:32, schrieb Nick Coghlan: > >> +1 to hashlib from me (especially since we used that as the best > >> available home for compare_digest). > > > > I'm afraid your memor

Re: [Python-Dev] Right place for PBKDF2 wrapper

2013-10-14 Thread Serhiy Storchaka
13.10.13 13:39, Christian Heimes написав(ла): Am 13.10.2013 08:32, schrieb Nick Coghlan: +1 to hashlib from me (especially since we used that as the best available home for compare_digest). I'm afraid your memory doesn't serve you well. :( compare_digest is implemented in _operator.c. Its offi