mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-20 07:19:40 +08:00
Lowercase the str returned by BaseDefinition.type
This commit is contained in:
+5
-5
@@ -120,20 +120,20 @@ class BaseDefinition(object):
|
|||||||
Finally, here is what you can get from :attr:`type`:
|
Finally, here is what you can get from :attr:`type`:
|
||||||
|
|
||||||
>>> defs[0].type
|
>>> defs[0].type
|
||||||
'Module'
|
'module'
|
||||||
>>> defs[1].type
|
>>> defs[1].type
|
||||||
'Class'
|
'class'
|
||||||
>>> defs[2].type
|
>>> defs[2].type
|
||||||
'Instance'
|
'instance'
|
||||||
>>> defs[3].type
|
>>> defs[3].type
|
||||||
'Function'
|
'function'
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# generate the type
|
# generate the type
|
||||||
stripped = self.definition
|
stripped = self.definition
|
||||||
if isinstance(self.definition, er.InstanceElement):
|
if isinstance(self.definition, er.InstanceElement):
|
||||||
stripped = self.definition.var
|
stripped = self.definition.var
|
||||||
return type(stripped).__name__
|
return type(stripped).__name__.lower()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def path(self):
|
def path(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user