On Friday, November 11, 2016 at 10:46:12 AM UTC-6, Terry Brown wrote:
> As another aspect of this pattern, instead of testing,
> >
> > if ''.join(lines):
> >
> > the new code now tests:
> >
> > if all([z.isspace() for z in lines]):
>
> Those don't seem equivalent
Oops. I meant the following:
Instead of testing:
if not ''.join(lines).strip():
the new code now tests:
if all([z.isspace() for z in lines]):
This makes the gain in efficiency all the clearer. The former generates
*two* new strings which the GC must then deal with.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.