(Jul-25-2018, 04:10 AM)Skaperen Wrote: is all better in some way, like being faster?
all() stops at first occurance of False but
min()
have to go through all list elements. So it can be said that all()
is faster.If performance is a consideration then generator comprehension could be a choice:
if all(isinstance(x, float) for x in foo):List will not be created, instead values are returned one at the time and at first False code stops.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.