VirtualMailManager/pycompat.py
branchv0.6.x
changeset 224 7e9874a50d92
parent 219 0b6ce895e1dc
equal deleted inserted replaced
223:5c7b7cbb01cd 224:7e9874a50d92
    19         """
    19         """
    20         for element in iterable:
    20         for element in iterable:
    21             if not element:
    21             if not element:
    22                 return False
    22                 return False
    23         return True
    23         return True
       
    24 
       
    25 
       
    26 # http://docs.python.org/library/functions.html#any
       
    27 try:
       
    28     any = any
       
    29 except NameError:
       
    30     def any(iterable):
       
    31         """Return True if any element of the *iterable* is true.  If the
       
    32         iterable is empty, return False.
       
    33 
       
    34         """
       
    35         for element in iterable:
       
    36             if element:
       
    37                 return True
       
    38         return False