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