1
0
forked from VimPlug/jedi

Scope.names_dict implementation.

This commit is contained in:
Dave Halter
2014-10-23 00:51:02 +02:00
parent 4f4aef7ac8
commit 3bbce49fd3
2 changed files with 29 additions and 9 deletions

View File

@@ -660,7 +660,13 @@ class SubModule(Scope, Module):
return False
class Class(Scope):
class ClassOrFunc(Scope):
@property
def name(self):
return self.children[1]
class Class(ClassOrFunc):
"""
Used to store the parsed contents of a python class.
@@ -686,11 +692,6 @@ class Class(Scope):
else:
return self.children[3]
@property
def name(self):
return self.children[1] # First token after `def`
@property
def doc(self):
"""
@@ -709,7 +710,7 @@ class Class(Scope):
yield self, filter_after_position(self.get_defined_names(), position)
class Function(Scope):
class Function(ClassOrFunc):
"""
Used to store the parsed contents of a python function.