mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-05 07:07:37 +08:00
Move a BaseContext to jedi.common.context.
This commit is contained in:
@@ -1 +1 @@
|
||||
from jedi.common.context import BaseContextSet
|
||||
from jedi.common.context import BaseContextSet, BaseContext
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
class BaseContext(object):
|
||||
def __init__(self, evaluator, parent_context=None):
|
||||
self.evaluator = evaluator
|
||||
self.parent_context = parent_context
|
||||
|
||||
def get_root_context(self):
|
||||
context = self
|
||||
while True:
|
||||
if context.parent_context is None:
|
||||
return context
|
||||
context = context.parent_context
|
||||
|
||||
|
||||
class BaseContextSet(object):
|
||||
def __init__(self, *args):
|
||||
self._set = set(args)
|
||||
|
||||
Reference in New Issue
Block a user