Show More
@@ -183,17 +183,17 b' class hybrid(wrapped):' | |||||
183 | self._values = values |
|
183 | self._values = values | |
184 | self._makemap = makemap |
|
184 | self._makemap = makemap | |
185 | self._joinfmt = joinfmt |
|
185 | self._joinfmt = joinfmt | |
186 | self.keytype = keytype # hint for 'x in y' where type(x) is unresolved |
|
186 | self._keytype = keytype # hint for 'x in y' where type(x) is unresolved | |
187 |
|
187 | |||
188 | def contains(self, context, mapping, item): |
|
188 | def contains(self, context, mapping, item): | |
189 | item = unwrapastype(context, mapping, item, self.keytype) |
|
189 | item = unwrapastype(context, mapping, item, self._keytype) | |
190 | return item in self._values |
|
190 | return item in self._values | |
191 |
|
191 | |||
192 | def getmember(self, context, mapping, key): |
|
192 | def getmember(self, context, mapping, key): | |
193 | # TODO: maybe split hybrid list/dict types? |
|
193 | # TODO: maybe split hybrid list/dict types? | |
194 | if not util.safehasattr(self._values, 'get'): |
|
194 | if not util.safehasattr(self._values, 'get'): | |
195 | raise error.ParseError(_('not a dictionary')) |
|
195 | raise error.ParseError(_('not a dictionary')) | |
196 | key = unwrapastype(context, mapping, key, self.keytype) |
|
196 | key = unwrapastype(context, mapping, key, self._keytype) | |
197 | return self._wrapvalue(key, self._values.get(key)) |
|
197 | return self._wrapvalue(key, self._values.get(key)) | |
198 |
|
198 | |||
199 | def getmin(self, context, mapping): |
|
199 | def getmin(self, context, mapping): |
General Comments 0
You need to be logged in to leave comments.
Login now