Added kombu.utils.all() and .any() for Python 2.4

This commit is contained in:
Ask Solem 2010-11-10 12:28:27 +01:00
parent 2458a7cbdb
commit f5aeb88561
2 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,27 @@
############## __builtin__.all ##############################################
try:
all([True])
all = all
except NameError:
def all(iterable):
for item in iterable:
if not item:
return False
return True
############## __builtin__.any ##############################################
try:
any([True])
any = any
except NameError:
def any(iterable):
for item in iterable:
if item:
return True
return False
############## collections.OrderedDict #######################################
import weakref

View File

@ -14,7 +14,6 @@ cover3-exclude = kombu
kombu.transport.pycouchdb
kombu.transport.mongodb
kombu.transport.beanstalk
kombu.pidbox
kombu.compat
[build_sphinx]