Sfoglia il codice sorgente

Added TaskSetResult.__getitem__

Ask Solem 15 anni fa
parent
commit
46acfab72c
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      celery/result.py

+ 3 - 0
celery/result.py

@@ -259,6 +259,9 @@ class TaskSetResult(object):
         """``iter(res)`` -> ``res.iterate()``."""
         return self.iterate()
 
+    def __getitem__(self, index):
+        return self.subtasks[index]
+
     def iterate(self):
         """Iterate over the return values of the tasks as they finish
         one by one.