Re: [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

2013-10-17 Thread Gregory P. Smith
Right again. The simplest rule to remember seems to be don't use yield or yield-from inside a with-statement. You can relax it by limiting it to context managers that manage any kind of shared resource, but that is probably already too subtle: e.g. yielding inside with open(file) as f seems

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

2013-10-12 Thread Gregory P. Smith
On Sat, Oct 12, 2013 at 11:06 AM, Georg Brandl g.bra...@gmx.net wrote: Am 12.10.2013 19:37, schrieb Antoine Pitrou: On Sat, 12 Oct 2013 19:19:44 +0200 Christian Heimes christ...@python.org wrote: ... * add PBKDF2 to ``hashlib`` * make ``hashlib`` a package and add PBKDF2 to a new

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

2013-10-12 Thread Gregory P. Smith
On Sat, Oct 12, 2013 at 2:31 PM, Christian Heimes christ...@python.orgwrote: Am 12.10.2013 23:04, schrieb Gregory P. Smith: agreed with any of these three. I'm going for hashlib.pbkdf2_hmac() for now. Right now it's just one function. We can always add a new module for a high level

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

2013-10-11 Thread Gregory P. Smith
On Fri, Oct 11, 2013 at 11:41 AM, Glenn Linderman v+pyt...@g.nevcal.comwrote: On 10/11/2013 10:19 AM, Eric V. Smith wrote: On 10/11/2013 12:43 PM, Barry Warsaw wrote: On Oct 11, 2013, at 06:27 PM, Georg Brandl wrote: Maybe to fit in with other verb-like APIs used as context managers:

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

2013-10-03 Thread Gregory P. Smith
On Thu, Oct 3, 2013 at 11:42 AM, Christian Heimes christ...@python.orgwrote: Hi, some of you may have seen that I'm working on a PEP for a new hash API and new algorithms for hashing of bytes and str. The PEP has three major aspects. It introduces DJB's SipHash as secure hash algorithm,

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

2013-10-03 Thread Gregory P. Smith
On Thu, Oct 3, 2013 at 12:05 PM, Guido van Rossum gu...@python.org wrote: We already have adopted a feature that plugged most viable attacks on web apps, I think that's enough. Actually... we did not do a very good job on that: http://bugs.python.org/issue14621 The point of allowing

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

2013-10-03 Thread Gregory P. Smith
On Thu, Oct 3, 2013 at 1:06 PM, Victor Stinner victor.stin...@gmail.comwrote: 2013/10/3 Christian Heimes christ...@python.org: A hash algorithm can be added and one avaible hash algorithm can be set before Py_Initialize() is called for the first time. Py_Initialize is not the good guard.

Re: [Python-Dev] Compiler for the Mac OS X version of Python 3.4

2013-09-18 Thread Gregory P. Smith
Just drop support for 10.6 with Python 3.4. Problem solved. People on that old of a version of the OS can build their own Python 3.4 or do the right thing and upgrade or just install Linux. This isn't Windows. Compiler tool chains are freely available for the legacy platform. We don't need to

Re: [Python-Dev] Compiler for the Mac OS X version of Python 3.4

2013-09-18 Thread Gregory P. Smith
On Wed, Sep 18, 2013 at 6:38 AM, Ronald Oussoren ronaldousso...@mac.comwrote: On Sep 18, 2013, at 03:03 PM, Martin v. Löwis mar...@v.loewis.de wrote: Am 15.09.13 00:56, schrieb Ryan: +1. A 10.6-only build makes sense. I'd like to support Russell's point: this could put a burden on

Re: [Python-Dev] EINTR handling...

2013-08-31 Thread Gregory P. Smith
On Fri, Aug 30, 2013 at 10:57 AM, Guido van Rossum gu...@python.org wrote: I don't have a strong opinion on this either. The distinction between send() and send_all() makes sense to me though (send_all() works hard to get all your data out, send() only does what it can quickly). Personally

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-31 Thread Gregory P. Smith
First, I really like this. +1 On Wed, Aug 28, 2013 at 6:07 PM, Victor Stinner victor.stin...@gmail.comwrote: 2013/8/29 Victor Stinner victor.stin...@gmail.com: My proposed implementation for Python 3.4 is different: * no enable() / disable() function: tracemalloc can only be enabled

Re: [Python-Dev] Inherance of file descriptor and handles on Windows (PEP 446)

2013-07-26 Thread Gregory P. Smith
On Fri, Jul 26, 2013 at 3:23 PM, Antoine Pitrou solip...@pitrou.net wrote: On Sat, 27 Jul 2013 00:18:40 +0200 Victor Stinner victor.stin...@gmail.com wrote: 2013/7/26 Antoine Pitrou solip...@pitrou.net: On Fri, 26 Jul 2013 22:17:47 +0200 On Linux, setting the close-on-flag has a low

Re: [Python-Dev] [Python-checkins] cpython (3.3): return NULL here

2013-07-24 Thread Gregory P. Smith
On Tue, Jul 23, 2013 at 8:46 AM, Ronald Oussoren ronaldousso...@mac.comwrote: On 23 Jul, 2013, at 17:36, Christian Heimes christ...@python.org wrote: Am 23.07.2013 17:10, schrieb Benjamin Peterson: PyErr_SetFromErrno() already and always returns NULL. Or do you prefer to return NULL

Re: [Python-Dev] Avoiding error from repr() of recursive dictview

2013-07-22 Thread Gregory P. Smith
On Mon, Jul 22, 2013 at 2:44 PM, Ben North b...@redfrontdoor.org wrote: Hi, A friend of mine, Ruadhan O'Flanagan, came across a bug which turned out to be the one noted in [http://bugs.python.org/issue18019], i.e.: d={} d[42]=d.viewvalues() d segmentation fault This issue has been

Re: [Python-Dev] Misc re.match() complaint

2013-07-15 Thread Gregory P. Smith
On Mon, Jul 15, 2013 at 4:14 PM, Guido van Rossum gu...@python.org wrote: In a discussion about mypy I discovered that the Python 3 version of the re module's Match object behaves subtly different from the Python 2 version when the target string (i.e. the haystack, not the needle) is a buffer

Re: [Python-Dev] Tweaking PEP 8 guidelines for use of leading underscores

2013-07-14 Thread Gregory P. Smith
+1 This is already how we've been behaving for years. On Sun, Jul 14, 2013 at 4:09 AM, Nick Coghlan ncogh...@gmail.com wrote: On 14 July 2013 18:11, Nick Coghlan ncogh...@gmail.com wrote: Currently, the naming section of PEP 8 doesn't say very much about what a leading underscore *means*

Re: [Python-Dev] [Python-checkins] cpython (3.3): Issue #17860: explicitly mention that std* streams are opened in binary mode by

2013-07-06 Thread Gregory P. Smith
Please update the docstring in subprocess.py with the wording improvements that you settle on while you're at it. On Sat, Jul 6, 2013 at 6:03 AM, Ronald Oussoren ronaldousso...@mac.comwrote: On 6 Jul, 2013, at 14:09, Ronald Oussoren ronaldousso...@mac.com wrote: On 6 Jul, 2013, at 13:59,

Re: [Python-Dev] End of the mystery @README.txt Mercurial bug

2013-07-01 Thread Gregory P. Smith
If we disallowed builds *from in source tree* requiring all output to go into a separate build output directory instead (like any sane person does*) we wouldn't need a crazy find in the source tree to mess things up. ;) this can be done today: $ mkdir foo cd foo ../my-hg/2.7/configure

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-24 Thread Gregory P. Smith
On Jun 24, 2013 9:11 PM, Guido van Rossum gu...@python.org wrote: On Mon, Jun 24, 2013 at 7:47 PM, Raymond Hettinger raymond.hettin...@gmail.com wrote: On Jun 24, 2013, at 4:07 AM, Victor Stinner victor.stin...@gmail.com wrote: Out of curiosity, do you know (remember) how was the number

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-23 Thread Gregory P. Smith
Your work is great! I even agree with the changes on a coding best practices level. It's just that it belongs on the default (3.4) branch as it is an enhancement, not a bug fix. We don't do new things on release branches. I agree that can be extremely frustrating at times, knowing that code

Re: [Python-Dev] cpython (2.7): Fix comment blocks. Adjust blocksize to a power-of-two for better divmod

2013-06-18 Thread Gregory P. Smith
Raymond - Why did you do this in the 2.7 branch? It hasn't been done in 3.3 or default and it isn't not the sort of change we make in a stable release branch without justification. What issue was this for? What problem were you solving? -gps On Mon, Jun 17, 2013 at 11:08 PM, Ethan Furman

Re: [Python-Dev] cpython: Issue #3329: Add new APIs to customize memory allocators

2013-06-15 Thread Gregory P. Smith
fwiw i'm also supportive of adding these apis. Lets PEP away to iron out any details or document disagreements but overall I'd also like to see something a lot like these go in. -gps On Fri, Jun 14, 2013 at 10:50 PM, Nick Coghlan ncogh...@gmail.com wrote: On 15 June 2013 11:54, Victor

Re: [Python-Dev] backported Enum

2013-06-15 Thread Gregory P. Smith
I tend to just pick a name and stick with it. subprocess32 is subprocess backported from 3.2 (with the 3.3 timeout feature also in it). unittest2 is unittest from 2.7. It tends to work. and it also emphasizes that i'm unlikely to backport future non-bugfix updates beyond the release mentioned

Re: [Python-Dev] PEP 442 delegate

2013-05-22 Thread Gregory P. Smith
+1 I second the scoundrel! fwiw, that pep being implemented is going to be a great addition to Python. :) On Tue, May 21, 2013 at 8:57 AM, Antoine Pitrou solip...@pitrou.net wrote: Hello, I would like to nominate Benjamin as BDFL-Delegate for PEP 442. Please tell me if you would like to

Re: [Python-Dev] Purpose of Doctests [Was: Best practices for Enum]

2013-05-19 Thread Gregory P. Smith
On Sat, May 18, 2013 at 11:41 PM, Raymond Hettinger raymond.hettin...@gmail.com wrote: On May 14, 2013, at 9:39 AM, Gregory P. Smith g...@krypto.org wrote: Bad: doctests. I'm hoping that core developers don't get caught-up in the doctests are bad meme. So long as doctests insist

Re: [Python-Dev] Purpose of Doctests [Was: Best practices for Enum]

2013-05-19 Thread Gregory P. Smith
On May 19, 2013 4:31 PM, Benjamin Peterson benja...@python.org wrote: 2013/5/19 Gregory P. Smith g...@krypto.org: Idea: I don't believe anybody has written a fixer for lib2to3 that applies fixers to doctests. That'd be an interesting project for someone. 2to3 can operate on doctests

Re: [Python-Dev] Mysterious Python pyc file corruption problems

2013-05-16 Thread Gregory P. Smith
On Thu, May 16, 2013 at 11:04 AM, Barry Warsaw ba...@python.org wrote: On May 16, 2013, at 09:44 AM, Ethan Furman wrote: Is it happening on the same machines? If so, perhaps a daemon to monitor those files and then scream and shout when one changes. Might help track down what's going on at

Re: [Python-Dev] Issue 11406: adding os.scandir(), a directory iterator returning stat-like info

2013-05-14 Thread Gregory P. Smith
On Sun, May 12, 2013 at 3:04 PM, Ben Hoyt benh...@gmail.com wrote: And if we're creating a custom object instead, why return a 2-tuple rather than making the entry's name an attribute of the custom object? To me, that suggests a more reasonable API for os.scandir() might be for it to be

Re: [Python-Dev] Best practices for Enum

2013-05-14 Thread Gregory P. Smith
On Sun, May 12, 2013 at 4:49 PM, Raymond Hettinger raymond.hettin...@gmail.com wrote: * will enums break doctests or any existing user code Those are already broken by design. We shouldn't be limited just because someone wrote a bad test that assumed a particular repr of a value. We've

Re: [Python-Dev] Best practices for Enum

2013-05-14 Thread Gregory P. Smith
Bad: doctests. On Tue, May 14, 2013 at 5:08 AM, Steven D'Aprano st...@pearwood.infowrote: On 14/05/13 16:51, Gregory P. Smith wrote: [...] This sounds like a feature request for doctest. doctest could be educated about enums and automatically compare to the integer value for such cases

Re: [Python-Dev] Fighting the theoretical randomness of is on immutables

2013-05-06 Thread Gregory P. Smith
On Mon, May 6, 2013 at 7:50 PM, Terry Jan Reedy tjre...@udel.edu wrote: On 5/6/2013 6:34 PM, Antoine Pitrou wrote: On Mon, 06 May 2013 18:23:02 -0400 Terry Jan Reedy tjre...@udel.edu wrote: 'Item' is necessarily left vague for mutable sequences as bytearrays also store values. The fact

Re: [Python-Dev] The end of 2.7

2013-04-07 Thread Gregory P. Smith
On Sun, Apr 7, 2013 at 6:53 AM, Christian Tismer tis...@stackless.comwrote: Hi Skip, On 07.04.13 14:10, Skip Montanaro wrote: I started writing this last night before the flurry of messages which arrived overnight. I thought originally, Oh, Skip, you're being too harsh. But now I'm not

Re: [Python-Dev] The end of 2.7

2013-04-06 Thread Gregory P. Smith
I agree with Benjamin though is it really necessary to do two 2.7 releases a year for the last two years? that's rather rapid (but as the release manager its your call). A few of us (sorry I forgot who all was there though I think Martin was?) had a discussion at PyCon a few weeks ago and seemed

Re: [Python-Dev] Safely importing zip files with C extensions

2013-03-28 Thread Gregory P. Smith
On Thu, Mar 28, 2013 at 9:09 AM, Brett Cannon br...@python.org wrote: On Thu, Mar 28, 2013 at 10:44 AM, Thomas Heller thel...@ctypes.orgwrote: Am 27.03.2013 20:38, schrieb Vinay Sajip: This quote is here to stop GMane complaining that I'm top-posting. Ignore. I've already posted this

Re: [Python-Dev] Can we triple quoted string as a comment?

2013-03-25 Thread Gregory P. Smith
On Mon, Mar 25, 2013 at 2:16 PM, Victor Stinner victor.stin...@gmail.comwrote: Hi, I just realized that the Python peephole optimizer removes useless instructions like numbers and strings between other instructions, without raising an error nor emiting an error. Example: $ python -Wd -c

Re: [Python-Dev] cpython: Closes issue 17467. Add readline and readlines support to

2013-03-20 Thread Gregory P. Smith
On Tue, Mar 19, 2013 at 9:44 PM, Michael Foord fuzzy...@voidspace.org.ukwrote: On 19 Mar 2013, at 17:26, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 20 Mar 2013 01:22:58 +0100 (CET) michael.foord python-check...@python.org wrote: http://hg.python.org/cpython/rev/684b75600fa9

Re: [Python-Dev] Python Language Summit at PyCon: Agenda

2013-03-02 Thread Gregory P. Smith
On Thu, Feb 28, 2013 at 1:15 AM, Nick Coghlan ncogh...@gmail.com wrote: On Thu, Feb 28, 2013 at 1:37 PM, Barry Warsaw ba...@python.org wrote: On Feb 27, 2013, at 11:33 AM, fwierzbi...@gmail.com wrote: The easy part for Jython is pushing some of our if is_jython: stuff into the appropriate

Re: [Python-Dev] cffi in stdlib

2013-03-01 Thread Gregory P. Smith
On Wed, Feb 27, 2013 at 7:57 AM, Eli Bendersky eli...@gmail.com wrote: I read the cffi docs once again and went through some of the examples. I want to divide this to two topics. One is what you call the ABI level. IMHO, it's hands down superior to ctypes. Your readdir demo

Re: [Python-Dev] cpython (2.7): - Issue #17086: Backport the patches from the 3.3 branch to cross-build

2013-02-03 Thread Gregory P. Smith
On Thu, Jan 31, 2013 at 11:14 PM, Antoine Pitrou solip...@pitrou.netwrote: On Fri, 1 Feb 2013 11:00:24 +1000 Nick Coghlan ncogh...@gmail.com wrote: On Fri, Feb 1, 2013 at 9:50 AM, Antoine Pitrou solip...@pitrou.net wrote: On Thu, 31 Jan 2013 23:52:27 +0100 (CET) matthias.klose

Re: [Python-Dev] Interested in GSoC 2013

2013-02-03 Thread Gregory P. Smith
First, welcome to Python. For people just starting out contributing we have setup a core-mentorship mailing list ideally suited for this type of question. http://mail.python.org/mailman/listinfo/core-mentorship general tip: look for open issues marked with the 'easy' on bugs.python.org. On

Re: [Python-Dev] Release or not release the GIL

2013-02-01 Thread Gregory P. Smith
On Fri, Feb 1, 2013 at 7:22 AM, Antoine Pitrou solip...@pitrou.net wrote: Le Fri, 1 Feb 2013 15:18:39 +0100, Amaury Forgeot d'Arc amaur...@gmail.com a écrit : 2013/2/1 Charles-François Natali cf.nat...@gmail.com dup2(oldfd, newfd) closes oldfd. No, it doesn't close oldfd.

Re: [Python-Dev] Add e (close and exec) mode to open()

2013-01-07 Thread Gregory P. Smith
On Mon, Jan 7, 2013 at 4:03 PM, Benjamin Peterson benja...@python.orgwrote: 2013/1/7 Victor Stinner victor.stin...@gmail.com: Hi, I would like add a new flag to open() mode to close the file on exec: e. This feature exists using different APIs depending on the OS and OS version:

Re: [Python-Dev] test___all__ polluting sys.modules?

2012-12-31 Thread Gregory P. Smith
On Sun, Dec 30, 2012 at 5:33 AM, Eli Bendersky eli...@gmail.com wrote: On Sat, Dec 29, 2012 at 5:34 PM, Nick Coghlan ncogh...@gmail.com wrote: On Sun, Dec 30, 2012 at 10:46 AM, Benjamin Peterson benja...@python.org wrote: 2012/12/29 Eli Bendersky eli...@gmail.com: Hi, This came up

Re: [Python-Dev] test___all__ polluting sys.modules?

2012-12-31 Thread Gregory P. Smith
On Sun, Dec 30, 2012 at 6:48 AM, R. David Murray rdmur...@bitdance.comwrote: On Mon, 31 Dec 2012 00:38:47 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Mon, Dec 31, 2012 at 12:19 AM, Eli Bendersky eli...@gmail.com wrote: On Sun, Dec 30, 2012 at 5:54 AM, Stefan Krah ste...@bytereef.org

Re: [Python-Dev] Possible GIL/threading issue involving subprocess and PyMem_MALLOC...

2012-12-20 Thread Gregory P. Smith
On Thu, Dec 20, 2012 at 10:43 AM, Trent Nelson tr...@snakebite.org wrote: This seems odd to me so I wanted to see what others think. The unit test Lib/unittest/test/test_runner.py:Test_TextRunner.test_warnings will eventually hit subprocess.Popen._communicate. The

Re: [Python-Dev] cpython: Using 'long double' to force this structure to be worst case aligned is no

2012-12-14 Thread Gregory P. Smith
On Fri, Dec 14, 2012 at 12:02 AM, Ronald Oussoren ronaldousso...@mac.comwrote: On 14 Dec, 2012, at 8:27, Gregory P. Smith g...@krypto.org wrote: On Mon, Dec 10, 2012 at 11:16 PM, Antoine Pitrou solip...@pitrou.netwrote: On Tue, 11 Dec 2012 03:05:19 +0100 (CET) gregory.p.smith python-check

Re: [Python-Dev] cpython: Using 'long double' to force this structure to be worst case aligned is no

2012-12-14 Thread Gregory P. Smith
, Mark Dickinson dicki...@gmail.com wrote: On Fri, Dec 14, 2012 at 7:27 AM, Gregory P. Smith g...@krypto.org wrote: So changing the definition of the dummy side of the union makes zero difference to already compiled code as it (a) doesn't change the structure's size and (b) all existing

Re: [Python-Dev] cpython: Using 'long double' to force this structure to be worst case aligned is no

2012-12-13 Thread Gregory P. Smith
On Mon, Dec 10, 2012 at 11:16 PM, Antoine Pitrou solip...@pitrou.netwrote: On Tue, 11 Dec 2012 03:05:19 +0100 (CET) gregory.p.smith python-check...@python.org wrote: Using 'long double' to force this structure to be worst case aligned is no longer required as of Python 2.5+ when the

Re: [Python-Dev] cpython: Using 'long double' to force this structure to be worst case aligned is no

2012-12-13 Thread Gregory P. Smith
On Thu, Dec 13, 2012 at 11:27 PM, Gregory P. Smith g...@krypto.org wrote: On Mon, Dec 10, 2012 at 11:16 PM, Antoine Pitrou solip...@pitrou.netwrote: On Tue, 11 Dec 2012 03:05:19 +0100 (CET) gregory.p.smith python-check...@python.org wrote: Using 'long double' to force this structure

Re: [Python-Dev] cpython: Using 'long double' to force this structure to be worst case aligned is no

2012-12-13 Thread Gregory P. Smith
On Mon, Dec 10, 2012 at 11:21 PM, Antoine Pitrou solip...@pitrou.netwrote: On Tue, 11 Dec 2012 08:16:27 +0100 Antoine Pitrou solip...@pitrou.net wrote: On Tue, 11 Dec 2012 03:05:19 +0100 (CET) gregory.p.smith python-check...@python.org wrote: Using 'long double' to force this

Re: [Python-Dev] More compact dictionaries with faster iteration

2012-12-09 Thread Gregory P. Smith
On Sun, Dec 9, 2012 at 5:44 PM, Raymond Hettinger raymond.hettin...@gmail.com wrote: The current memory layout for dictionaries is unnecessarily inefficient. It has a sparse table of 24-byte entries containing the hash value, key pointer, and value pointer. Instead, the 24-byte entries

Re: [Python-Dev] PEP 3145 (With Contents)

2012-12-08 Thread Gregory P. Smith
I'm really not sure what this PEP is trying to get at given that it contains no examples and sounds from the descriptions to be adding a complicated api on top of something that already, IMNSHO, has too much it (subprocess.Popen). Regardless, any user can use the stdout/err/in file objects with

Re: [Python-Dev] PEP 3145 (With Contents)

2012-12-08 Thread Gregory P. Smith
On Sat, Dec 8, 2012 at 8:14 PM, Glyph gl...@twistedmatrix.com wrote: On Dec 7, 2012, at 5:10 PM, anatoly techtonik techto...@gmail.com wrote: What about reading from other file descriptors? subprocess.Popen allows arbitrary file descriptors to be used. Is there any provision here for

Re: [Python-Dev] Proposing Argument Clinic, a new way of specifying arguments to builtins for CPython

2012-12-03 Thread Gregory P. Smith
On Mon, Dec 3, 2012 at 2:29 PM, Larry Hastings la...@hastings.org wrote: Say there, the Python core development community! Have I got a question for you! *ahem* Which of the following four options do you dislike least? ;-) 1) CPython continues to provide no function signature

Re: [Python-Dev] Handling support for newer OS features at run time

2012-11-27 Thread Gregory P. Smith
On Tue, Nov 27, 2012 at 3:19 PM, Trent Nelson tr...@snakebite.org wrote: On Tue, Nov 27, 2012 at 03:09:12PM -0800, Matthias Klose wrote: Am 27.11.2012 23:49, schrieb Trent Nelson: I don't think we've currently got the ability to do this, right? Is there a precedent set anywhere

Re: [Python-Dev] urlretrieve regression no.2, now in Python 3.3

2012-11-07 Thread Gregory P. Smith
On Wed, Nov 7, 2012 at 2:42 PM, Terry Reedy tjre...@udel.edu wrote: On 11/7/2012 5:57 AM, anatoly techtonik wrote: urlretrieve has a callback parameter, which takes function with the following prototype: def callback(block_number, block_size, total_size): pass Where block_size was

Re: [Python-Dev] Python 3.3 vs. Python 2.7 benchmark results (again, but this time more solid numbers)

2012-10-27 Thread Gregory P. Smith
One word: profile. Looking at stat counts alone rather than measuring the total time spent in all types of system calls from strace and profiling is not really useful. ;) Another thing to keep an eye out for within a startup profile: how often does the gc collect? our default gc collection

Re: [Python-Dev] Thread/garbage collection race in Popen

2012-10-05 Thread Gregory P. Smith
On Thu, Oct 4, 2012 at 8:56 PM, Ben Leslie be...@benno.id.au wrote: Hi all, I have a Python program where I have many threads each calling Popen, and I was hitting some trouble. I've been seeing this on 3.2.3, however I believe the same issue is still potentially a problem on head. The

Re: [Python-Dev] Stdlib and timezones, again

2012-09-30 Thread Gregory P. Smith
On Sun, Sep 30, 2012 at 8:33 AM, Benjamin Peterson benja...@python.orgwrote: 2012/9/30 Xavier Morel python-...@masklinn.net: But at worst, an outdated unicode database will be missing data right? Doesn't an outdated timezone db have the risk of returning *incorrect* data? Unicode

Re: [Python-Dev] Stdlib and timezones, again

2012-09-30 Thread Gregory P. Smith
On Sun, Sep 30, 2012 at 3:17 PM, Matthias Klose d...@ubuntu.com wrote: On 30.09.2012 20:18, Gregory P. Smith wrote: On Sun, Sep 30, 2012 at 8:33 AM, Benjamin Peterson benja...@python.org wrote: 2012/9/30 Xavier Morel python-...@masklinn.net: But at worst, an outdated unicode database

Re: [Python-Dev] Benchmarking Python 3.3 against Python 2.7 (wide build)

2012-09-30 Thread Gregory P. Smith
Interesting results! Another data point for the benchmarks that would be interesting is memory consumption of the python process during the runs. In 3.3 a reasonable place to gather this would be to add a callback to the new gc.callbacks and save a snapshot of the process's memory usage before

Re: [Python-Dev] make decimal the default non-integer instead of float?

2012-09-29 Thread Gregory P. Smith
-cc: python-dev +cc: python-ideas On Sat, Sep 29, 2012 at 11:39 AM, Chris Angelico ros...@gmail.com wrote: On Sun, Sep 30, 2012 at 4:26 AM, Brett Cannon br...@python.org wrote: Does this mean we want to re-open the discussion about decimal constants? Last time this came up I think we

[Python-Dev] why is _PyBytes_Join not public but PyUnicode_Join is?

2012-08-30 Thread Gregory P. Smith
We have use for _PyBytes_Join in an extension module but technically it isn't a public Python C API... anyone know why? PyUnicode_Join is. Looking up the bytes 'join' method and using the C API to call that method object with proper parameters seems like overkill in the case where we're not

Re: [Python-Dev] AST optimizer implemented in Python

2012-08-11 Thread Gregory P. Smith
On Sat, Aug 11, 2012 at 11:30 AM, Victor Stinner victor.stin...@gmail.comwrote: Hi, I started to implement an AST optimizer in Python. It's easy to create a new AST tree, so I'm surprised that I didn't find any existing project.

Re: [Python-Dev] test_hashlib

2012-07-21 Thread Gregory P. Smith
Fixed. The TypeError in this nonsense never gonna work use case is now consistent in 2.7, 3.2 and 3.3. On Sat, Jul 21, 2012 at 7:10 PM, R. David Murray rdmur...@bitdance.comwrote: On Sun, 22 Jul 2012 01:05:35 -, =?iso-8859-1?Q?Kristj=E1n_Valur_J=F3nsson?= krist...@ccpgames.com wrote:

Re: [Python-Dev] Restricted API versioning

2012-06-23 Thread Gregory P. Smith
On Sat, Jun 23, 2012 at 2:31 PM, Martin v. Löwis mar...@v.loewis.dewrote: I've been thinking about extensions to the stable ABI. On the one hand, introducing new API can cause extension modules not to run on older Python versions. On the other hand, the new API may well be stable in itself,

Re: [Python-Dev] deprecating .pyo and -O

2012-06-16 Thread Gregory P. Smith
On Thu, Jun 14, 2012 at 1:57 PM, Martin v. Löwis mar...@v.loewis.dewrote: I don't really see the point. In my experience there is no benefit to removing assert statements in production mode. This is a C-specific notion that doesn't really map very well to Python code. Do other high-level

Re: [Python-Dev] what is happening with the regex module going into Python 3.3?

2012-06-03 Thread Gregory P. Smith
On Fri, Jun 1, 2012 at 5:37 PM, Nick Coghlan ncogh...@gmail.com wrote: ipaddress really made it in because I personally ran into the limitations of not having IP address support in the stdlib. I ended up doing quite a bit of prompting to ensure the process of cleaning up the API to modern

Re: [Python-Dev] what is happening with the regex module going into Python 3.3?

2012-06-03 Thread Gregory P. Smith
On Sun, Jun 3, 2012 at 2:38 PM, Nick Coghlan ncogh...@gmail.com wrote: On Mon, Jun 4, 2012 at 6:25 AM, Gregory P. Smith g...@krypto.org wrote: On Fri, Jun 1, 2012 at 5:37 PM, Nick Coghlan ncogh...@gmail.com wrote: ipaddress really made it in because I personally ran into the limitations

Re: [Python-Dev] Proposal for better SSL errors

2012-05-26 Thread Gregory P. Smith
On Sat, May 26, 2012 at 12:28 PM, Antoine Pitrou solip...@pitrou.netwrote: Hello, In http://bugs.python.org/issue14837 I have attached a proof-of-concept patch to improve the exceptions raised by the ssl module when OpenSSL signals an error. The current situation is quite dismal, since you

Re: [Python-Dev] Highlighting reference-stealing APIs [was Re: cpython: Fix email post-commit review comments.]

2012-04-18 Thread Gregory P. Smith
On Wed, Apr 18, 2012 at 5:01 PM, David Malcolm dmalc...@redhat.com wrote: On Thu, 2012-04-19 at 10:48 +1200, Greg Ewing wrote: Antoine Pitrou wrote: (and here we see why reference-stealing APIs are a nuisance: because you never know in advance whether a function will steal a reference

Re: [Python-Dev] Possible change to logging.handlers.SysLogHandler

2012-04-10 Thread Gregory P. Smith
On Fri, Apr 6, 2012 at 1:06 PM, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: There is a problem with the way logging.handlers.SysLogHandler works when presented with Unicode messages. According to RFC 5424, Unicode is supposed to be sent encoded as UTF-8 and preceded by a BOM. However, the

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-09 Thread Gregory P. Smith
On Sat, Apr 7, 2012 at 4:56 PM, Glyph Lefkowitz gl...@twistedmatrix.comwrote: On Apr 7, 2012, at 3:40 AM, Steven D'Aprano wrote: In any case, NTP is not the only thing that adjusts the clock, e.g. the operating system will adjust the time for daylight savings. Daylight savings time is not

Re: [Python-Dev] PEP 418 is too divisive and confusing and should be postponed

2012-04-09 Thread Gregory P. Smith
On Mon, Apr 9, 2012 at 4:46 PM, Guido van Rossum gu...@python.org wrote: Is it still? I thought they fixed that ages ago? sadly, no. http://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html On Mon, Apr 9, 2012 at 4:42 PM, Gregory P. Smith g...@krypto.org wrote: On Sat, Apr 7, 2012 at 4:56 PM

Re: [Python-Dev] Playing with a new theme for the docs

2012-03-24 Thread Gregory P. Smith
On Tue, Mar 20, 2012 at 3:55 PM, John O'Connor jxo6...@rit.edu wrote: On Tue, Mar 20, 2012 at 6:38 PM, Georg Brandl g.bra...@gmx.net wrote: recently I've grown a bit tired of seeing our default Sphinx theme, especially as so many other projects use it. I think regardless of the chosen

Re: [Python-Dev] PEP 417: Adding mock to the Python Standard Library

2012-03-12 Thread Gregory P. Smith
+10 for the record. (given we all already agreed upon this in the summit :) make it so. On Mon, Mar 12, 2012 at 3:05 PM, Michael Foord mich...@voidspace.org.ukwrote: Hello all, At the Python Language Summit adding the mock library to the Python Standard Library was discussed and agreed.

Re: [Python-Dev] Status regarding Old vs. Advanced String Formating

2012-02-24 Thread Gregory P. Smith
On Fri, Feb 24, 2012 at 1:52 PM, Tshepang Lekhonkhobe tshep...@gmail.com wrote: On Fri, Feb 24, 2012 at 23:39, Martin v. Löwis mar...@v.loewis.de wrote: It is a burden for some people to learn and remember the exact details of both systems and exactly how they differ. Having both in the stdlib

Re: [Python-Dev] [Python-checkins] cpython (3.2): logging: Added locking in flush() and close() handler methods. Thanks to Fayaz

2012-02-23 Thread Gregory P. Smith
On Thu, Feb 23, 2012 at 12:04 PM, vinay.sajip python-check...@python.org wrote: http://hg.python.org/cpython/rev/b2adcd90e656 changeset:   75211:b2adcd90e656 branch:      3.2 parent:      75200:85d08a1ba74e user:        Vinay Sajip vinay_sa...@yahoo.co.uk date:        Thu Feb 23 19:45:52

Re: [Python-Dev] [Python-checkins] cpython (3.2): logging: Added locking in flush() and close() handler methods. Thanks to Fayaz

2012-02-23 Thread Gregory P. Smith
On Thu, Feb 23, 2012 at 5:51 PM, Gregory P. Smith g...@krypto.org wrote: On Thu, Feb 23, 2012 at 12:04 PM, vinay.sajip python-check...@python.org wrote: http://hg.python.org/cpython/rev/b2adcd90e656 changeset:   75211:b2adcd90e656 branch:      3.2 parent:      75200:85d08a1ba74e user

Re: [Python-Dev] Issue 13703 is closed for the Python 2.6 branch

2012-02-22 Thread Gregory P. Smith
On Wed, Feb 22, 2012 at 10:14 AM, Barry Warsaw ba...@python.org wrote: Two more small details to address, and then I think we're ready to start creating release candidates.  - sys.flags.hash_randomization   In the tracker issue, I had previously stated a preference that this flag   only

Re: [Python-Dev] [Python-checkins] cpython (merge 2.6 - 2.7): merge 2.6 with hash randomization fix

2012-02-20 Thread Gregory P. Smith
On Mon, Feb 20, 2012 at 10:19 PM, Gregory P. Smith g...@krypto.org wrote: Look at PCbuild/pythoncore.vcproj within this commit, it looks like you committed (or merged) a merge conflict marker in the file. -gps On Mon, Feb 20, 2012 at 6:49 PM, benjamin.peterson python-check...@python.org

Re: [Python-Dev] How to round timestamps and durations?

2012-02-14 Thread Gregory P. Smith
On Mon, Feb 13, 2012 at 4:59 AM, Victor Stinner victor.stin...@gmail.com wrote: Hi, My work on the PEP 410 tries to unify the code to manipulate timestamps. The problem is that I'm unable to decide how to round these numbers. Functions using a resolution of 1 second (e.g. time.mktime)

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Gregory P. Smith
On Tue, Feb 14, 2012 at 2:29 PM, Barry Warsaw ba...@python.org wrote: I think I will just state my reasoning one last time and then leave it to the BDFL or BDFOP to make the final decision. Victor on IRC says that there is not much difference between Decimal and timedelta, and this may be

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Gregory P. Smith
On Tue, Feb 14, 2012 at 4:23 PM, Nick Coghlan ncogh...@gmail.com wrote: On Wed, Feb 15, 2012 at 8:29 AM, Barry Warsaw ba...@python.org wrote: My primary concern with the PEP is adding to users confusion when they have to handle (at least) 5 different types[*] that represent time in Python.

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Gregory P. Smith
On Tue, Feb 14, 2012 at 5:13 PM, Gregory P. Smith g...@krypto.org wrote: On Tue, Feb 14, 2012 at 4:23 PM, Nick Coghlan ncogh...@gmail.com wrote: On Wed, Feb 15, 2012 at 8:29 AM, Barry Warsaw ba...@python.org wrote: My primary concern with the PEP is adding to users confusion when they have

Re: [Python-Dev] peps: Update with bugfix releases.

2012-02-12 Thread Gregory P. Smith
On Sun, Feb 5, 2012 at 11:23 AM, Ned Deily n...@acm.org wrote: In article e1ru7g3-0007mb...@dinsdale.python.org,  georg.brandl python-check...@python.org wrote: +Bugfix Releases +=== + +- 3.2.1: released July 10, 2011 +- 3.2.2: released September 4, 2011 + +- 3.2.3: planned

Re: [Python-Dev] Is this safe enough? Re: [Python-checkins] cpython: _Py_Identifier are always ASCII strings

2012-02-07 Thread Gregory P. Smith
Why do we still care about C89? It is 2012 and we're talking about Python 3. What compiler on what platform that anyone actually cares about does not support C99? -gps ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] which C language standard CPython must conform to

2012-02-07 Thread Gregory P. Smith
On Tue, Feb 7, 2012 at 1:41 PM, Martin v. Löwis mar...@v.loewis.de wrote: Am 07.02.2012 20:10, schrieb Gregory P. Smith: Why do we still care about C89?  It is 2012 and we're talking about Python 3.  What compiler on what platform that anyone actually cares about does not support C99

Re: [Python-Dev] PEP: New timestamp formats

2012-02-03 Thread Gregory P. Smith
Why is the PEP promoting the float type being used as the default on the new-in-3.3 APIs that were added explicitly to provide nanosecond level resolution that cannot be represented by a float? The *new* APIs should default to the high precision return value (be that datetime/timedelta or

Re: [Python-Dev] [issue13703] Hash collision security issue

2012-01-29 Thread Gregory P. Smith
On Fri, Jan 27, 2012 at 11:39 AM, mar...@v.loewis.de wrote: In fact, none of the strategies fixes all issues with hash collisions; even the hash-randomization solutions only deal with string keys, and don't consider collisions on non-string keys. The hash-randomization approach also works

Re: [Python-Dev] plugging the hash attack

2012-01-29 Thread Gregory P. Smith
On Fri, Jan 27, 2012 at 6:33 PM, Benjamin Peterson benja...@python.org wrote: 2012/1/27 Steven D'Aprano st...@pearwood.info: Benjamin Peterson wrote: Hello everyone, In effort to get a fix out before Perl 6 goes mainstream, Barry and I have decided to pronounce on what we want for our stable

Re: [Python-Dev] PEP 408 -- Standard library __preview__ package

2012-01-29 Thread Gregory P. Smith
On Fri, Jan 27, 2012 at 9:26 AM, Alex alex.gay...@gmail.com wrote: Eli Bendersky eliben at gmail.com writes: Hello, Following an earlier discussion on python-ideas [1], we would like to propose the following PEP for review. Discussion is welcome. The PEP can also be viewed in HTML form at

Re: [Python-Dev] [Python-checkins] cpython (3.2): Fixes issue #8052: The posix subprocess module's close_fds behavior was

2012-01-22 Thread Gregory P. Smith
On Sat, Jan 21, 2012 at 4:21 PM, Benjamin Peterson benja...@python.org wrote: 2012/1/21 gregory.p.smith python-check...@python.org: ... +/* Convert ASCII to a positive int, no libc call. no overflow. -1 on error. */ Is no libc call important? Yes. strtol() is not on the async signal safe

Re: [Python-Dev] cpython (3.2): Avoid the compiler warning about the unused return value.

2012-01-21 Thread Gregory P. Smith
On Sat, Jan 21, 2012 at 2:33 PM, Stefan Krah ste...@bytereef.org wrote: Benjamin Peterson benja...@python.org wrote: Can't that give you another warning about the ssize_t being truncated to int? How about the following instead?   (void) write(...); Also, if you use a recent enough

Re: [Python-Dev] cpython (3.2): Fixes issue #8052: The posix subprocess module's close_fds behavior was

2012-01-21 Thread Gregory P. Smith
:        Gregory P. Smith g...@krypto.org date:        Sat Jan 21 14:01:08 2012 -0800 summary:   Fixes issue #8052: The posix subprocess module's close_fds behavior was suboptimal by closing all possible file descriptors rather than just the open ones in the child process before exec

Re: [Python-Dev] Hashing proposal: change only string-only dicts

2012-01-19 Thread Gregory P. Smith
On Wed, Jan 18, 2012 at 9:55 AM, Martin v. Löwis mar...@v.loewis.dewrote: Am 18.01.2012 17:01, schrieb PJ Eby: On Tue, Jan 17, 2012 at 7:58 PM, Martin v. Löwis mar...@v.loewis.de mailto:mar...@v.loewis.de wrote: Am 17.01.2012 22:26, schrieb Antoine Pitrou: Only 2 bits are used

Re: [Python-Dev] Daily reference leaks (12de1ad1cee8): sum=6024

2012-01-18 Thread Gregory P. Smith
On Wed, Jan 18, 2012 at 12:50 PM, Antoine Pitrou solip...@pitrou.net wrote: Well, they should be fixed now :-) Regards Antoine. awesome! :) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Hashing proposal: change only string-only dicts

2012-01-17 Thread Gregory P. Smith
On Tue, Jan 17, 2012 at 12:59 PM, Martin v. Löwis mar...@v.loewis.dewrote: I'd like to propose a different approach to seeding the string hashes: only do so for dictionaries involving only strings, and leave the tp_hash slot of strings unchanged. Each string would get two hashes: the public

Re: [Python-Dev] Status of the fix for the hash collision vulnerability

2012-01-17 Thread Gregory P. Smith
On Tue, Jan 17, 2012 at 12:52 PM, Martin v. Löwis mar...@v.loewis.dewrote: I plan to commit my fix to Python 3.3 if it is accepted. Then write a simplified version to Python 3.2 and backport it to 3.1. I'm opposed to any change to the hash values of strings in maintenance releases, so I

Re: [Python-Dev] Status of the fix for the hash collision vulnerability

2012-01-16 Thread Gregory P. Smith
, Gregory P. Smith wrote: It is perfectly okay to break existing users who had anything depending on ordering of internal hash tables. Their code was already broken. Given that the doc says Return the hash value of the object, I do not think we should be so hard-nosed. The above

<    1   2   3   4   5   6   7   >