mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Make it possible to use ContextSet with an iterable parameter
This commit is contained in:
@@ -13,6 +13,10 @@ class BaseContext(object):
|
|||||||
|
|
||||||
class BaseContextSet(object):
|
class BaseContextSet(object):
|
||||||
def __init__(self, *args):
|
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:
|
for arg in args:
|
||||||
assert not isinstance(arg, BaseContextSet)
|
assert not isinstance(arg, BaseContextSet)
|
||||||
self._set = frozenset(args)
|
self._set = frozenset(args)
|
||||||
|
|||||||
Reference in New Issue
Block a user