Request for feedback on my first Python program

Sean Legassick sean at datamage.net
Sun Jun 1 02:52:17 CEST 2003


In message <slrnbdeevn.694.andrew-usenet at athena.jcn.srcf.net>, Andrew 
Walkingshaw <andrew-usenet at lexical.org.uk> writes
>def isMeaningful(line):
>    if line != "" and line[0] != "#":
>        return True
>    else:
>        return False

Yuck!

def isMeaningful(line):
     return line != "" and line[0] != "#";

No offence intended, but I've seen this too often in real code not to 
point out its redundancy here.

Sean

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