Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread Stephen J. Turnbull
On Wed, Apr 18, 2012 at 8:25 AM, Victor Stinner victor.stin...@gmail.com wrote: Ok ok, resolution / accuracy / precision are confusing (or at least not well known concepts). Maybe not to us, but in fields like astronomy and mechanical engineering there are commonly accepted definitions:

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-18 Thread martin
Well, we specifically decided that objects with __del__ methods that are part of a cycle cannot be run. The same reasoning was applied to generators, if they are in a certain state. What makes iobase so special that its 'close' method can be run even if it is part of a cycle? It's a hack,

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Hrvoje Niksic
On 04/17/2012 04:21 PM, Guido van Rossum wrote: I hope that's now what it says about slices -- that was meant for dict displays. For slices it should be symmetrical. In this case I would remove the spaces around the +, but it's okay to add spaces around the : too. It does look odd to have an

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Floris Bruynooghe
On 17 April 2012 16:36, Barry Warsaw ba...@python.org wrote: On Apr 17, 2012, at 08:25 AM, R. David Murray wrote: On Tue, 17 Apr 2012 08:53:43 +0200, Matej Cepl mc...@redhat.com wrote: On 16.4.2012 18:10, Nam Nguyen wrote: a_list[pos + 1 : -1] or other way around a_list[pos+1:-1] That's

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread Victor Stinner
Ok ok, resolution / accuracy / precision are confusing (or at least not well known concepts). Maybe not to us, but in fields like astronomy and mechanical engineering there are commonly accepted definitions: I was just talking of the name of the time.perf_counter() function: perf_counter vs

Re: [Python-Dev] [Python-checkins] cpython: Fix #14600. Correct reference handling and naming of ImportError convenience

2012-04-18 Thread Nick Coghlan
On Wed, Apr 18, 2012 at 7:57 AM, brian.curtin python-check...@python.org wrote: diff --git a/Python/errors.c b/Python/errors.c --- a/Python/errors.c +++ b/Python/errors.c @@ -586,50 +586,43 @@  #endif /* MS_WINDOWS */  PyObject * -PyErr_SetExcWithArgsKwargs(PyObject *exc, PyObject *args,

Re: [Python-Dev] [Python-checkins] cpython: Fix #14600. Correct reference handling and naming of ImportError convenience

2012-04-18 Thread Oleg Broytman
On Wed, Apr 18, 2012 at 09:19:03PM +1000, Nick Coghlan ncogh...@gmail.com wrote: On Wed, Apr 18, 2012 at 7:57 AM, brian.curtin python-check...@python.org wrote: diff --git a/Python/errors.c b/Python/errors.c --- a/Python/errors.c +++ b/Python/errors.c @@ -586,50 +586,43 @@ + args =

Re: [Python-Dev] Setting up a RHEL6 buildbot

2012-04-18 Thread Nick Coghlan
On Fri, Mar 23, 2012 at 1:48 PM, Nick Coghlan ncogh...@gmail.com wrote: I'm looking into getting a RHEL6 system set up to add to the buildbot fleet. This is getting closer to being ready to go. Could one of the BB admins contact me off-list to set up the slave name and password? Cheers, Nick.

[Python-Dev] webbrowser no longer support 'internet-config' on Mac

2012-04-18 Thread Leo
The doc says supported as in http://docs.python.org/library/webbrowser.html but the code has been deleted in http://hg.python.org/cpython/rev/66b3eda6283f Leo ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] [Python-checkins] cpython: Fix email post-commit review comments.

2012-04-18 Thread Nick Coghlan
On Wed, Apr 18, 2012 at 11:31 PM, brian.curtin python-check...@python.org wrote: -    if (name == NULL) +    if (name == NULL) { +        Py_INCREF(Py_None);         name = Py_None; +    } A slightly more traditional way to write that would be: name = Py_None; Py_INCREF(name); -  

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread Stephen J. Turnbull
On Wed, Apr 18, 2012 at 7:29 PM, Victor Stinner victor.stin...@gmail.com wrote: If anyone is motivated to write a perfect (or at least better) glossary, please do it! We don't want a perfect glossary, we want one we agree on, that defines terms consistently with the way they're used in the

Re: [Python-Dev] [Python-checkins] cpython: Fix email post-commit review comments.

2012-04-18 Thread R. David Murray
We're seeing segfuilts on the buildbots now. Example: http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20Shared%203.x/builds/5715 On Wed, 18 Apr 2012 23:39:34 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Wed, Apr 18, 2012 at 11:31 PM, brian.curtin python-check...@python.org

Re: [Python-Dev] webbrowser no longer support 'internet-config' on Mac

2012-04-18 Thread R. David Murray
Please submit a bug report at bugs.python.org. Bugs posted to this mailing list tend to get forgotten unless a tracker issue is created. On Wed, 18 Apr 2012 20:54:28 +0800, Leo sdl@gmail.com wrote: The doc says supported as in http://docs.python.org/library/webbrowser.html but the code

Re: [Python-Dev] webbrowser no longer support 'internet-config' on Mac

2012-04-18 Thread Brett Cannon
Please file a bug report at bugs.python.org so this isn't lost. On Wed, Apr 18, 2012 at 08:54, Leo sdl@gmail.com wrote: The doc says supported as in http://docs.python.org/library/webbrowser.html but the code has been deleted in http://hg.python.org/cpython/rev/66b3eda6283f Leo

Re: [Python-Dev] cpython: Fix email post-commit review comments.

2012-04-18 Thread Antoine Pitrou
On Wed, 18 Apr 2012 15:31:10 +0200 brian.curtin python-check...@python.org wrote: http://hg.python.org/cpython/rev/bf23a6c215f6 changeset: 76388:bf23a6c215f6 parent: 76385:6762b943ee59 user:Brian Curtin br...@python.org date:Wed Apr 18 08:30:51 2012 -0500 summary:

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Guido van Rossum
On Wed, Apr 18, 2012 at 1:29 AM, Floris Bruynooghe f...@devork.be wrote: And since this is OT by now, one of the other pep8 annoyances I have[0] is the blanket whitespace around arithmetic operators, including **.  To me the first just looks ugly: 1024 ** 2 1024**2 Certainly when the

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Chris Angelico
On Thu, Apr 19, 2012 at 12:47 AM, Guido van Rossum gu...@python.org wrote: I don't believe PEP 8 requires whitespace around all binary operators. Where do you read that? Quoting from http://www.python.org/dev/peps/pep-0008/#other-recommendations (with elision): Use spaces around arithmetic

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Georg Brandl
On 18.04.2012 17:47, Chris Angelico wrote: On Thu, Apr 19, 2012 at 12:47 AM, Guido van Rossumgu...@python.org wrote: I don't believe PEP 8 requires whitespace around all binary operators. Where do you read that? Quoting from http://www.python.org/dev/peps/pep-0008/#other-recommendations

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Guido van Rossum
On Wed, Apr 18, 2012 at 9:25 AM, Georg Brandl g.bra...@gmx.net wrote: On 18.04.2012 17:47, Chris Angelico wrote: On Thu, Apr 19, 2012 at 12:47 AM, Guido van Rossumgu...@python.org  wrote:  I don't believe PEP 8 requires whitespace around all binary operators.  Where do you read that?

[Python-Dev] __hash__ documentation

2012-04-18 Thread Ethan Furman
http://bugs.python.org/issue14617 Patch attached to issue. ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Brian Curtin
On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: http://bugs.python.org/issue14617 Patch attached to issue. Can I request that you not immediately post issues to python-dev? Those who follow the bug tracker will see the issue and act accordingly. (unless I missed some

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Ethan Furman
Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: Those who follow the bug tracker will see the issue and act accordingly. How does one follow the bug tracker? ~Ethan~ ___ Python-Dev mailing list

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Benjamin Peterson
2012/4/18 Ethan Furman et...@stoneleaf.us: Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: Those who follow the bug tracker will see the issue and act accordingly. How does one follow the bug tracker? One checks occasionally to see if anything

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Antoine Pitrou
On Wed, 18 Apr 2012 12:19:39 -0700 Ethan Furman et...@stoneleaf.us wrote: Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: Those who follow the bug tracker will see the issue and act accordingly. How does one follow the bug tracker? Checking it

Re: [Python-Dev] [Python-checkins] cpython: Issue #11750: The Windows API functions scattered in the _subprocess and

2012-04-18 Thread Martin v. Löwis
Am 18.04.2012 20:52, schrieb antoine.pitrou: http://hg.python.org/cpython/rev/f3a27d11101a changeset: 76405:f3a27d11101a user:Antoine Pitrou solip...@pitrou.net date:Wed Apr 18 20:51:15 2012 +0200 summary: Issue #11750: The Windows API functions scattered in the

Re: [Python-Dev] cpython: Issue #11750: The Windows API functions scattered in the _subprocess and

2012-04-18 Thread Antoine Pitrou
On Wed, 18 Apr 2012 21:29:00 +0200 Martin v. Löwis mar...@v.loewis.de wrote: Am 18.04.2012 20:52, schrieb antoine.pitrou: http://hg.python.org/cpython/rev/f3a27d11101a changeset: 76405:f3a27d11101a user:Antoine Pitrou solip...@pitrou.net date:Wed Apr 18 20:51:15 2012

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Martin v. Löwis
Am 18.04.2012 21:19, schrieb Ethan Furman: Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: Those who follow the bug tracker will see the issue and act accordingly. How does one follow the bug tracker? I do by subscribing to new-bugs-announce.

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Ethan Furman
Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: http://bugs.python.org/issue14617 Patch attached to issue. Can I request that you not immediately post issues to python-dev? Those who follow the bug tracker will see the issue and act accordingly.

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread Terry Reedy
On 4/18/2012 2:45 AM, Stephen J. Turnbull wrote: On Wed, Apr 18, 2012 at 8:25 AM, Victor Stinner victor.stin...@gmail.com wrote: Ok ok, resolution / accuracy / precision are confusing (or at least not well known concepts). Maybe not to us, but in fields like astronomy and mechanical

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Terry Reedy
On 4/18/2012 3:19 PM, Ethan Furman wrote: Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: Those who follow the bug tracker will see the issue and act accordingly. How does one follow the bug tracker? I look at the Friday summary, paying particular

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread R. David Murray
On Wed, 18 Apr 2012 15:50:13 -0400, Terry Reedy tjre...@udel.edu wrote: On 4/18/2012 2:45 AM, Stephen J. Turnbull wrote: On Wed, Apr 18, 2012 at 8:25 AM, Victor Stinner victor.stin...@gmail.com wrote: Ok ok, resolution / accuracy / precision are confusing (or at least not well known

Re: [Python-Dev] webbrowser no longer support 'internet-config' on Mac

2012-04-18 Thread Ned Deily
In article 20120418140936.21dd7250...@webabinitio.net, R. David Murray rdmur...@bitdance.com wrote: Please submit a bug report at bugs.python.org. Bugs posted to this mailing list tend to get forgotten unless a tracker issue is created. On Wed, 18 Apr 2012 20:54:28 +0800, Leo

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Ned Deily
In article 20120418211404.2700d...@pitrou.net, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 18 Apr 2012 12:19:39 -0700 Ethan Furman et...@stoneleaf.us wrote: Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman et...@stoneleaf.us wrote: Those who follow the bug tracker

Re: [Python-Dev] cpython: Fix email post-commit review comments.

2012-04-18 Thread Eric Snow
On Wed, Apr 18, 2012 at 8:21 AM, Antoine Pitrou solip...@pitrou.net 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 or not, and you have to read the docs for each and every C API call you make) +1

Re: [Python-Dev] cpython: Fix email post-commit review comments.

2012-04-18 Thread Greg Ewing
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 or not, and you have to read the docs for each and every C API call you make) Fortunately, they're very rare, so you don't encounter

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread Victor Stinner
If anyone is motivated to write a perfect (or at least better) glossary, please do it! We don't want a perfect glossary, we want one we agree on, that defines terms consistently with the way they're used in the PEP. However, what I read in this thread is that the PEP protagonist doesn't

Re: [Python-Dev] cpython: Fix email post-commit review comments.

2012-04-18 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/18/2012 06:48 PM, Greg Ewing wrote: Functions with ref-stealing APIs really ought to have a naming convention that makes them stand out and remind you to consult the documentation. Maybe we should mandate that their names end with '_rtfm'.

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

2012-04-18 Thread David Malcolm
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 or not, and you have to read the docs for each and every C API call you

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Steven D'Aprano
Hrvoje Niksic wrote: The same oddity occurs with expressions in kwargs calls: func(pos1, pos2, keyword=foo + bar) I find myself wanting to add parentheses arround the + to make the code clearer. Then why don't you? In the above example, spaces around the + are not only optional but

Re: [Python-Dev] cpython: Fix email post-commit review comments.

2012-04-18 Thread Greg Ewing
On 19/04/12 11:22, Tres Seaver wrote: Maybe we should mandate that their names end with '_rtfm'. +1 -- Greg ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

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] cpython: Fix email post-commit review comments.

2012-04-18 Thread Nick Coghlan
On Thu, Apr 19, 2012 at 12:21 AM, Antoine Pitrou solip...@pitrou.net wrote: I don't think INCREFs were necessary, actually. PyDict_SetItemString doesn't steal a reference. Yes, I was tired when that checkin went by and my brain didn't register that the function was otherwise using borrowed refs

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

2012-04-18 Thread Nick Coghlan
On Thu, Apr 19, 2012 at 11:04 AM, Gregory P. Smith g...@krypto.org wrote: +1  Adding these annotations and setting up a buildbot that builds using cpychecker would be a great. Even without the extra annotations, running cpychecker on at least one of the buildbots might be helpful. I'm in the

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Stephen J. Turnbull
On Thu, Apr 19, 2012 at 5:16 AM, Ned Deily n...@acm.org wrote: Ethan Furman et...@stoneleaf.us wrote: How does one follow the bug tracker? [informative and useful answers elided] I would like to summarize this thread and add it to the dev documentation. Where should it go? (If nobody

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread Stephen J. Turnbull
On Thu, Apr 19, 2012 at 8:15 AM, Victor Stinner victor.stin...@gmail.com wrote: Well, I asked on IRC what I should do for these definitions because I'm too tired to decide what to do. [[...]] I replaced these definitions with yours. That was nice of you. In return, I'll go over the PEP to

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Nick Coghlan
On Thu, Apr 19, 2012 at 11:35 AM, Stephen J. Turnbull step...@xemacs.org wrote: On Thu, Apr 19, 2012 at 5:16 AM, Ned Deily n...@acm.org wrote: Ethan Furman et...@stoneleaf.us wrote: How does one follow the bug tracker? [informative and useful answers elided] I would like to summarize

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-18 Thread Victor Stinner
That was nice of you.  In return, I'll go over the PEP to check that usage is appropriate (eg, in some places resolution was used in the sense of computer science's precision == reported digits). Oh, this is very likely :-) BTW, this not a criticism, you did a great job of putting all that

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Eli Bendersky
Quoting from http://www.python.org/dev/peps/pep-0008/#other-recommendations (with elision): Use spaces around arithmetic operators:    No:       i=i+1       submitted +=1       x = x*2 - 1       hypot2 = x*x + y*y       c = (a+b) * (a-b) End quote. I agree that this could be

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Chris Angelico
On Thu, Apr 19, 2012 at 1:06 PM, Eli Bendersky eli...@gmail.com wrote: (quoting GvR) Let's change this to something more reasonable, e.g. If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies). This is very much to

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Guido van Rossum
On Wed, Apr 18, 2012 at 8:14 PM, Chris Angelico ros...@gmail.com wrote: On Thu, Apr 19, 2012 at 1:06 PM, Eli Bendersky eli...@gmail.com wrote: (quoting GvR) Let's change this to something more reasonable, e.g. If operators with different priorities are used, consider adding whitespace

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Raymond Hettinger
On Apr 18, 2012, at 1:38 PM, Guido van Rossum wrote: Let's change this to something more reasonable, e.g. If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies). This is very much to taste, however, never use more