mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-25 09:48:36 +08:00
add __repr__ to api.Script
This commit is contained in:
+2
-2
@@ -8,9 +8,9 @@ example for the autocompletion feature:
|
|||||||
|
|
||||||
>>> import jedi
|
>>> import jedi
|
||||||
>>> source = '''import json; json.l'''
|
>>> source = '''import json; json.l'''
|
||||||
>>> script = jedi.Script(source, 1, 19, '')
|
>>> script = jedi.Script(source, 1, 19, 'example.py')
|
||||||
>>> script
|
>>> script
|
||||||
<jedi.api.Script at 0x7f6d40f3db90>
|
<Script: 'example.py'>
|
||||||
>>> completions = script.complete()
|
>>> completions = script.complete()
|
||||||
>>> completions
|
>>> completions
|
||||||
[<Completion: load>, <Completion: loads>]
|
[<Completion: load>, <Completion: loads>]
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ class Script(object):
|
|||||||
self.source_path = source_path
|
self.source_path = source_path
|
||||||
debug.speed('init')
|
debug.speed('init')
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return '<%s: %s>' % (self.__class__.__name__, repr(self.source_path))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _parser(self):
|
def _parser(self):
|
||||||
""" lazy parser."""
|
""" lazy parser."""
|
||||||
|
|||||||
Reference in New Issue
Block a user