A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-March/052012.html below:

[Python-Dev] Adding any() and all()

[Python-Dev] Adding any() and all() [Python-Dev] Adding any() and all()Bill Janssen janssen at parc.com
Fri Mar 11 03:38:27 CET 2005
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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4