From bbc6e830e24855a83e9c621a92ca459f67536699 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 24 Sep 2018 09:43:35 +0200 Subject: [PATCH] Make it possible to use ContextSet with an iterable parameter --- jedi/common/context.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jedi/common/context.py b/jedi/common/context.py index a1883b19..0d873900 100644 --- a/jedi/common/context.py +++ b/jedi/common/context.py @@ -13,6 +13,10 @@ class BaseContext(object): class BaseContextSet(object): def __init__(self, *args): + if len(args) == 1 and hasattr(args[0], '__iter__'): + # TODO replace with this everywhere. + self._set = frozenset(args[0]) + return for arg in args: assert not isinstance(arg, BaseContextSet) self._set = frozenset(args)