Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-10 Thread Guido van Rossum
On Wed, Jun 8, 2011 at 8:12 AM, Nick Coghlan ncogh...@gmail.com wrote: On Wed, Jun 8, 2011 at 7:35 AM, David Malcolm dmalc...@redhat.com wrote: After ~12 years of doing this, it comes naturally.  I appreciate that this may come across as weird though :) I actually thought Brett's rationale in

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread Steven D'Aprano
Terry Reedy wrote: On 6/7/2011 5:35 PM, David Malcolm wrote: I know that this style is unpopular, but if it helps, try mentally pronouncing == in C as is the value of. In this example, when I read that line, my mind is thinking: if 'u' is the value of typecode After ~12 years of

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread Nick Coghlan
On Wed, Jun 8, 2011 at 7:35 AM, David Malcolm dmalc...@redhat.com wrote: After ~12 years of doing this, it comes naturally.  I appreciate that this may come across as weird though :) I actually thought Brett's rationale in the checkin comment was reasonable (if you get in the habit of putting

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread Alexander Belopolsky
On Wed, Jun 8, 2011 at 7:04 AM, Steven D'Aprano st...@pearwood.info wrote: .. Whereas I read it as 'has the value' (or just 'is' ;=). Am I the only one who reads == as equals? If you are, you are the only one who reads it correctly. Consider a = 2 a == 2.0 True

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-08 Thread R. David Murray
On Wed, 08 Jun 2011 21:04:48 +1000, Steven D'Aprano st...@pearwood.info wrote: Terry Reedy wrote: On 6/7/2011 5:35 PM, David Malcolm wrote: I know that this style is unpopular, but if it helps, try mentally pronouncing == in C as is the value of. In this example, when I read that

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Georg Brandl
On 06/07/11 05:20, brett.cannon wrote: http://hg.python.org/cpython/rev/fc282e375703 changeset: 70695:fc282e375703 user:Brett Cannon br...@python.org date:Mon Jun 06 20:20:36 2011 -0700 summary: Remove some extraneous parentheses and swap the comparison order to prevent

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Antoine Pitrou
On Tue, 07 Jun 2011 08:57:10 +0200 Georg Brandl g.bra...@gmx.net wrote: On 06/07/11 05:20, brett.cannon wrote: http://hg.python.org/cpython/rev/fc282e375703 changeset: 70695:fc282e375703 user:Brett Cannon br...@python.org date:Mon Jun 06 20:20:36 2011 -0700 summary:

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread M.-A. Lemburg
Georg Brandl wrote: On 06/07/11 05:20, brett.cannon wrote: http://hg.python.org/cpython/rev/fc282e375703 changeset: 70695:fc282e375703 user:Brett Cannon br...@python.org date:Mon Jun 06 20:20:36 2011 -0700 summary: Remove some extraneous parentheses and swap the

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Eli Bendersky
Swapping the comparison order here seems a bit inconsistent to me. There are lots of others around (e.g. len == 0 in the patch context below). Why is this one so special? I think that another developer even got told off once for these kinds of comparisons. I hope the Clang warning is only

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Guido van Rossum
On Tue, Jun 7, 2011 at 2:47 AM, Eli Bendersky eli...@gmail.com wrote: Swapping the comparison order here seems a bit inconsistent to me. There are lots of others around (e.g. len == 0 in the patch context below). Why is this one so special? I think that another developer even got told off

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Alexander Belopolsky
.. I agree with Georg: if ('u' == typecode) is not well readable, since you usually put the variable part on the left and the constant part on the right of an equal comparison. I appear to be in the minority here, but this particular example does not strike me as egregiously unreadable. To

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread David Malcolm
On Tue, 2011-06-07 at 11:03 +0200, M.-A. Lemburg wrote: Georg Brandl wrote: On 06/07/11 05:20, brett.cannon wrote: http://hg.python.org/cpython/rev/fc282e375703 changeset: 70695:fc282e375703 user:Brett Cannon br...@python.org date:Mon Jun 06 20:20:36 2011 -0700

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread R. David Murray
On Tue, 07 Jun 2011 17:42:17 -0400, Alexander Belopolsky alexander.belopol...@gmail.com wrote: .. I agree with Georg: if ('u' == typecode) is not well readable, since you usually put the variable part on the left and the constant part on the right of an equal comparison. I appear to be

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Terry Reedy
On 6/7/2011 5:35 PM, David Malcolm wrote: I know that this style is unpopular, but if it helps, try mentally pronouncing == in C as is the value of. In this example, when I read that line, my mind is thinking: if 'u' is the value of typecode After ~12 years of doing this, it comes

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Brett Cannon
On Mon, Jun 6, 2011 at 23:57, Georg Brandl g.bra...@gmx.net wrote: On 06/07/11 05:20, brett.cannon wrote: http://hg.python.org/cpython/rev/fc282e375703 changeset: 70695:fc282e375703 user:Brett Cannon br...@python.org date:Mon Jun 06 20:20:36 2011 -0700 summary: