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

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 wrote: > On Thu, Apr 19, 2012 at 1:06 PM, Eli Bendersky 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 opera

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 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 tast

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

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

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Nick Coghlan
On Thu, Apr 19, 2012 at 11:35 AM, Stephen J. Turnbull wrote: > On Thu, Apr 19, 2012 at 5:16 AM, Ned Deily wrote: > >>> Ethan Furman 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 > do

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 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 check that usage is app

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Stephen J. Turnbull
On Thu, Apr 19, 2012 at 5:16 AM, Ned Deily wrote: >> Ethan Furman 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 bothers to answer, I'll assume

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 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 process of sett

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 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 for name and path

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 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 or > > >

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: http://mail.python.org/mai

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 discou

[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 yo

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'

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 > do

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 th

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 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 -eric _

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Ned Deily
In article <20120418211404.2700d...@pitrou.net>, Antoine Pitrou wrote: > On Wed, 18 Apr 2012 12:19:39 -0700 > Ethan Furman wrote: > > Brian Curtin wrote: > > > On Wed, Apr 18, 2012 at 13:07, Ethan Furman wrote: > > > Those who follow the bug tracker will see the issue and act > > > accordingly.

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" 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 wrote: > > The doc says sup

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 wrote: > On 4/18/2012 2:45 AM, Stephen J. Turnbull wrote: > > On Wed, Apr 18, 2012 at 8:25 AM, Victor Stinner > > wrote: > > > >> Ok ok, resolution / accuracy / precision are confusing (or at least > >> not well known concepts). > > > > Maybe not t

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 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 attention to issues

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 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 a

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Ethan Furman
Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman 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 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 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. Regards, Marti

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" wrote: > Am 18.04.2012 20:52, schrieb antoine.pitrou: > > http://hg.python.org/cpython/rev/f3a27d11101a > > changeset: 76405:f3a27d11101a > > user:Antoine Pitrou > > date:Wed Apr 18 20:51:15 2012 +0200 > > summary: > > Issue

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 > date:Wed Apr 18 20:51:15 2012 +0200 > summary: > Issue #11750: The Windows API functions scattered in the _subprocess and > _mult

Re: [Python-Dev] __hash__ documentation

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

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Benjamin Peterson
2012/4/18 Ethan Furman : > Brian Curtin wrote: >> >> On Wed, Apr 18, 2012 at 13:07, Ethan Furman 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 interesting has popped up or

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Ethan Furman
Brian Curtin wrote: On Wed, Apr 18, 2012 at 13:07, Ethan Furman 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 Python-Dev@python.org http://mai

Re: [Python-Dev] __hash__ documentation

2012-04-18 Thread Brian Curtin
On Wed, Apr 18, 2012 at 13:07, Ethan Furman 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 explicit request th

[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: http://mail.python.org/mailman/options/python-dev/archive%40mail-archi

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 wrote: > On 18.04.2012 17:47, Chris Angelico wrote: >> >> On Thu, Apr 19, 2012 at 12:47 AM, Guido van Rossum >>  wrote: >>> >>>  I don't believe PEP 8 requires whitespace around all binary operators. >>>  Where do you read that? >> >> >> Quoting from >

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 Rossum 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): Us

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 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 operators: No:

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 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 expres

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 wrote: > http://hg.python.org/cpython/rev/bf23a6c215f6 > changeset: 76388:bf23a6c215f6 > parent: 76385:6762b943ee59 > user:Brian Curtin > date:Wed Apr 18 08:30:51 2012 -0500 > summary: > Fix email post-commit review comments

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 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] 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 wrote: > The doc says supported as in > http://docs.python.org/library/webbrowser.html > > but the code has been delet

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 wrote: > On Wed, Apr 18, 2012 at 11:31 PM, brian.curtin > wrote: > > -    if (name == NULL) > > +  

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 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 PEP. However, what I read

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 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); > -    if (path == NULL) >

[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 http://mail.python.org/mailman/listinfo/pyt

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 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. -- Nick Coghlan

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 wrote: > On Wed, Apr 18, 2012 at 7:57 AM, brian.curtin > wrote: > > diff --git a/Python/errors.c b/Python/errors.c > > --- a/Python/errors.c > > +++ b/Python/errors.c > > @@ -586,50 +586,43 @@ > > + args = PyTuple_New(1); > > + if (args ==

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 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, PyObject *kwargs) >

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_coun

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 wrote: > On Apr 17, 2012, at 08:25 AM, R. David Murray wrote: > >>On Tue, 17 Apr 2012 08:53:43 +0200, Matej Cepl 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 wha

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 oper

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, an