Request for feedback on my first Python program

Sean Legassick sean at datamage.net
Sat May 31 23:30:39 EDT 2003


In message <20030601021106.GA7831 at mephisto.ghaering.de>, Gerhard Haering 
<gh at ghaering.de> writes
>No offence intended, but your code is redundant as well ;-)
>
>def isMeaningful(line):
>    return not line.startswith("#")

Indeed, that is cleaner.

I specifically wanted to point out that

if X:
   return True
else:
   return False

is a particularly ugly and surprisingly common redundancy - in many 
languages...

>And omit the trailing semicolon, you filthy C/C++/Java programmer :-P

...including these that are indeed more familiar to me.

I've been trying to wean myself off those darn semicolons when doing 
Python, but sometimes they slip through. As I find myself liking and 
using Python more and more every day I suspect the slips will become 
fewer.

-- 
Sean K. Legassick
sean at datamage.net
         informage - http://informage.net - mouthing off from the fairest cape






More information about the Python-list mailing list