mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
@@ -189,6 +189,9 @@ class AbstractInstanceContext(Context):
|
||||
elif scope.type == 'classdef':
|
||||
class_context = er.ClassContext(self.evaluator, scope, parent_context)
|
||||
return class_context
|
||||
elif scope.type == 'comp_for':
|
||||
# Comprehensions currently don't have a special scope in Jedi.
|
||||
return self.create_instance_context(class_context, scope)
|
||||
else:
|
||||
raise NotImplementedError
|
||||
return class_context
|
||||
|
||||
@@ -526,3 +526,10 @@ class Foo(object):
|
||||
Foo().create_class().a
|
||||
#? float()
|
||||
Foo().b
|
||||
|
||||
class Foo(object):
|
||||
def comprehension_definition(self):
|
||||
return [1 for self.b in [1]]
|
||||
|
||||
#? int()
|
||||
Foo().b
|
||||
|
||||
Reference in New Issue
Block a user