EDIT: ninjad by bowlofred
I think that any() documentation is quite clear:
- you need iterable
- you need expression which returns boolean value
- there is 'short-circuit' which breaks out of iteration if first True is encountered
- return value is boolean (True or False)
The way you try to use any is not the intended way.
Example: is there any filename in directory which name contains 'latest':
I think that any() documentation is quite clear:
- you need iterable
- you need expression which returns boolean value
- there is 'short-circuit' which breaks out of iteration if first True is encountered
- return value is boolean (True or False)
The way you try to use any is not the intended way.
Example: is there any filename in directory which name contains 'latest':
any('latest' in file_name for file_name in directory)If first True is encountered then any returns True and stops (this is the point of 'any' - it takes only one to make it True)
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.