mirror of https://github.com/celery/kombu.git
Added kombu.utils.all() and .any() for Python 2.4
This commit is contained in:
parent
2458a7cbdb
commit
f5aeb88561
|
@ -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 #######################################
|
############## collections.OrderedDict #######################################
|
||||||
|
|
||||||
import weakref
|
import weakref
|
||||||
|
|
Loading…
Reference in New Issue