[Python-Dev] Adding any() and all() (original) (raw)
Bill Janssen janssen at parc.com
Fri Mar 11 03:38:27 CET 2005
- Previous message: [Python-Dev] Adding any() and all()
- Next message: [Python-Dev] Adding any() and all()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido,
I think there should be a PEP. For instance, I think I'd want them to be:
def any(S): for x in S: if x: return x return S[-1]
def all(S): for x in S: if not x: return x return S[-1]
Or perhaps these should be called "first" and "last".
Bill
- Previous message: [Python-Dev] Adding any() and all()
- Next message: [Python-Dev] Adding any() and all()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]