aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/cycler/py2/patches/01-from-upstream.patch
blob: f794c44b6beced2454a2f835ab029b80a9d7dbc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- contrib/python/cycler/py2/cycler.py	(index)
+++ contrib/python/cycler/py2/cycler.py	(working tree)
@@ -87,7 +87,7 @@ class Cycler(object):
       in-place ``+``
 
     ``*``
-      for outer products (itertools.product) and integer multiplication
+      for outer products (`itertools.product`) and integer multiplication
 
     ``*=``
       in-place ``*``
@@ -135,6 +135,9 @@ class Cycler(object):
         self._keys = _process_keys(self._left, self._right)
         self._op = op
 
+    def __contains__(self, k):
+        return k in self._keys
+
     @property
     def keys(self):
         """
@@ -367,8 +370,7 @@ class Cycler(object):
         # and if we care.
 
         keys = self.keys
-        # change this to dict comprehension when drop 2.6
-        out = dict((k,  list()) for k in keys)
+        out = {k: list() for k in keys}
 
         for d in self:
             for k in keys: