Too Self Centered (Just)
Andres Rosado
arosado at softhome.net
Mon Jan 13 21:10:38 EST 2003
On 04:26 PM 1/11/2003 -0500, the keyboard of python-list-request at python.org
emitted:
>In article <3e2083fc$1 at nntp0.pdx.net>,
> Scott David Daniels <Scott.Daniels at Acm.Org> wrote:
>
> > > Or
> > > self.total = len[x for x in f.readlines() if x != '']
> > or self.total = len([None for x in f.readlines() if x != ''])
The None is a good trick. Also I forgot about the parenthesis.
>Still not better than the original, which doesn't build a (potentially
>long) list at all.
Good point taken.
--
Andres Rosado
Email: andresr at despammed.com
ICQ: 66750646
Homepage: http://andres980.tripod.com/
Any circuit design must contain at least one part which is obsolete, two parts
which are unobtainable, and three parts which are still under development.
More information about the Python-list
mailing list