Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:44

0001 # define some functions missing in python 2.4
0002 
0003 if not 'any' in dir(__builtins__):
0004     def any(iterable):
0005         """
0006         Return True if any element of the iterable is true.
0007         New in version 2.5.
0008         """
0009         for element in iterable:
0010             if element:
0011                 return True
0012         return False
0013 
0014 
0015 if not 'all' in dir(__builtins__):
0016     def all(iterable):
0017         """
0018         Return True if all elements of the iterable are true.
0019         New in version 2.5.
0020         """
0021         for element in iterable:
0022             if not element:
0023                 return False
0024         return True
0025