VirtualMailManager/pycompat.py
branchv0.6.x
changeset 219 0b6ce895e1dc
child 224 7e9874a50d92
equal deleted inserted replaced
218:84094c7fa28b 219:0b6ce895e1dc
       
     1 # -*- coding: UTF-8 -*-
       
     2 # Copyright (c) 2010, Pascal Volk
       
     3 # See COPYING for distribution information.
       
     4 
       
     5 """
       
     6     VirtualMailManager.pycompat
       
     7 
       
     8     VirtualMailManager's compatibility stuff for Python 2.4
       
     9 """
       
    10 
       
    11 # http://docs.python.org/library/functions.html#all
       
    12 try:
       
    13     all = all
       
    14 except NameError:
       
    15     def all(iterable):
       
    16         """Return True if all elements of the *iterable* are true
       
    17         (or if the iterable is empty).
       
    18 
       
    19         """
       
    20         for element in iterable:
       
    21             if not element:
       
    22                 return False
       
    23         return True