Beginning programming with Python

Mikael Olofsson mikael at isy.liu.se
Fri Nov 19 05:00:42 EST 1999


On 19-Nov-99 Boudewijn Rempt wrote:
 >  On Fri, 19 Nov 1999, Fredrik Lundh wrote:
 >  
 > > Boudewijn Rempt <boud at rempt.xs4all.nl> wrote:
 > > > I tend to forget the colons after function and class definitions and
 > > > everywhere else and the double == in if's - mainly because, for the life
 > > > of Brian, I can't see why they are there. It seems to me the language
 > > > would be just as easily parseable and readable without this bit of
 > > > interpunction.
 > > 
 > > guess you weren't part of the CWI design team -- they
 > > did test this on humans, you know, and discovered that
 > > the language wasn't as easily parseable and readable
 > > without the colons...
 > > 
 >  
 >  You needn't guess about that, I guess ;-). I didn't know there
 >  was a design team for Python, I though it was Guido's invention.
 >  But I still wonder about the double == - if I can't assign in
 >  an if, why insist on ==?

Consider the following:

>>> a=b==c
>>> if a:
...   print "foo"

Then compare that to the following:

>>> if b==c:
...   print "foo"

As I understand your thought, you want the following to be used:

>>> if b=c:
...   print "foo"

I would vomit if I had to write the test b==c as b=c sometimes, just 
because there is no ambiguity in those cases, which is what you are 
suggesting we should do.

My-keyboard-would-become-messy-ly y'rs

/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    19-Nov-99
Time:    10:50:07

This message was sent by XF-Mail.
-----------------------------------------------------------------------




More information about the Python-list mailing list