extract elements of n char from a list
Mark McEahern
marklists at mceahern.com
Fri Jul 26 13:39:03 EDT 2002
More information about the Python-list mailing list
Fri Jul 26 13:39:03 EDT 2002
- Previous message (by thread): extract elements of n char from a list
- Next message (by thread): automating control-D
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> well, i think that i could use : > > nl = [e for e in l if len(e) ==n] > > but is it efficient ? are they more efficient ways ? and when is > it good pythoner technique to use list comprehensions ? List comprehensions are just dandy, aren't they? No doubt you've heard about premature optimization is the root of all evil? Why are you worried about efficiency? What size list are you talking about? What other relevant facts are you not sharing with us? <wink> I would recommend you focus more on solving your problem and THEN, if it's too slow, use a profiler to locate bottlenecks. // mark
- Previous message (by thread): extract elements of n char from a list
- Next message (by thread): automating control-D
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list