mirror of
https://github.com/davidhalter/jedi.git
synced 2026-03-01 16:06:54 +08:00
Use unicode always for getting special objects
This commit is contained in:
@@ -111,7 +111,7 @@ class Evaluator(object):
|
|||||||
@property
|
@property
|
||||||
@evaluator_function_cache()
|
@evaluator_function_cache()
|
||||||
def builtins_module(self):
|
def builtins_module(self):
|
||||||
return compiled.get_special_object(self, 'BUILTINS')
|
return compiled.get_special_object(self, u'BUILTINS')
|
||||||
|
|
||||||
def reset_recursion_limitations(self):
|
def reset_recursion_limitations(self):
|
||||||
self.recursion_detector = recursion.RecursionDetector()
|
self.recursion_detector = recursion.RecursionDetector()
|
||||||
|
|||||||
@@ -83,9 +83,9 @@ class FunctionContext(use_metaclass(CachedMetaClass, TreeContext)):
|
|||||||
# This differentiation is only necessary for Python2. Python3 does not
|
# This differentiation is only necessary for Python2. Python3 does not
|
||||||
# use a different method class.
|
# use a different method class.
|
||||||
if isinstance(parser_utils.get_parent_scope(self.tree_node), tree.Class):
|
if isinstance(parser_utils.get_parent_scope(self.tree_node), tree.Class):
|
||||||
name = 'METHOD_CLASS'
|
name = u'METHOD_CLASS'
|
||||||
else:
|
else:
|
||||||
name = 'FUNCTION_CLASS'
|
name = u'FUNCTION_CLASS'
|
||||||
return compiled.get_special_object(self.evaluator, name)
|
return compiled.get_special_object(self.evaluator, name)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class GeneratorMixin(object):
|
|||||||
return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__())
|
return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__())
|
||||||
|
|
||||||
def get_filters(self, search_global, until_position=None, origin_scope=None):
|
def get_filters(self, search_global, until_position=None, origin_scope=None):
|
||||||
gen_obj = compiled.get_special_object(self.evaluator, 'GENERATOR_OBJECT')
|
gen_obj = compiled.get_special_object(self.evaluator, u'GENERATOR_OBJECT')
|
||||||
yield SpecialMethodFilter(self, self.builtin_methods, gen_obj)
|
yield SpecialMethodFilter(self, self.builtin_methods, gen_obj)
|
||||||
for filter in gen_obj.get_filters(search_global):
|
for filter in gen_obj.get_filters(search_global):
|
||||||
yield filter
|
yield filter
|
||||||
@@ -76,7 +76,7 @@ class GeneratorMixin(object):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def py__class__(self):
|
def py__class__(self):
|
||||||
gen_obj = compiled.get_special_object(self.evaluator, 'GENERATOR_OBJECT')
|
gen_obj = compiled.get_special_object(self.evaluator, u'GENERATOR_OBJECT')
|
||||||
return gen_obj.py__class__()
|
return gen_obj.py__class__()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ class ModuleContext(use_metaclass(CachedMetaClass, TreeContext)):
|
|||||||
return names
|
return names
|
||||||
|
|
||||||
def py__class__(self):
|
def py__class__(self):
|
||||||
return compiled.get_special_object(self.evaluator, 'MODULE_CLASS')
|
return compiled.get_special_object(self.evaluator, u'MODULE_CLASS')
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s: %s@%s-%s>" % (
|
return "<%s: %s@%s-%s>" % (
|
||||||
|
|||||||
Reference in New Issue
Block a user