Refactor Evaluator.wrap to use the types in a more consequent way.

This commit is contained in:
Dave Halter
2016-06-29 21:06:35 +02:00
parent a3b263a599
commit 689284c615
5 changed files with 19 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ TODO Some parts of this module are still not well documented.
import inspect
import re
import sys
import copy
from jedi._compatibility import builtins
from jedi import debug
@@ -31,7 +32,7 @@ class MixedModule(object):
# Usually we are dealing with very small code sizes when it comes to
# interpreter modules. In this case we just copy the whole syntax tree
# to be able to modify it.
self._parser_module = helpers.deep_ast_copy(parser_module)
self._parser_module = copy.deepcopy(parser_module)
for child in self._parser_module.children:
child.parent = self

View File

@@ -67,6 +67,8 @@ keywords_only_valid_as_leaf = (
class Keyword(object):
type = 'completion_keyword'
def __init__(self, evaluator, name, pos):
self.name = FakeName(name, self, pos)
self.start_pos = pos