Fix inferring dict.values()
This commit is contained in:
1 parent
43ffcb0802
commit
389d4e3d9c
5 files changed
+19
-5
No files matched your search
@@ -300,6 +300,17 @@ class ContextSet(BaseContextSet):
|
||||
def get_item(self, *args, **kwargs):
|
||||
return ContextSet.from_sets(_getitem(c, *args, **kwargs) for c in self._set)
|
||||
|
||||
def try_merge(self, function_name):
|
||||
context_set = self.__class__()
|
||||
for c in self._set:
|
||||
try:
|
||||
method = getattr(c, function_name)
|
||||
except AttributeError:
|
||||
pass
|
||||
else:
|
||||
context_set |= method()
|
||||
return context_set
|
||||
|
||||
|
||||
NO_CONTEXTS = ContextSet()
|
||||
|
||||
|
||||
Reference in new issue
Block a user