forked from VimPlug/jedi
Merge branch 'dev' of git://github.com/davidhalter/jedi
This commit is contained in:
@@ -16,11 +16,11 @@ is the easiest way to write a parser. The same behaviour applies to ``Param``,
|
||||
which is being used in a function definition.
|
||||
|
||||
The easiest way to play with this module is to use :class:`parsing.Parser`.
|
||||
:attr:`parsing.Parser.scope` holds an instance of :class:`SubModule`:
|
||||
:attr:`parsing.Parser.module` holds an instance of :class:`SubModule`:
|
||||
|
||||
>>> from jedi.parsing import Parser
|
||||
>>> parser = Parser('import os', 'example.py')
|
||||
>>> submodule = parser.scope
|
||||
>>> submodule = parser.module
|
||||
>>> submodule
|
||||
<SubModule: example.py@1-1>
|
||||
|
||||
@@ -248,14 +248,14 @@ class Scope(Simple, IsScope):
|
||||
... b = y
|
||||
... b.c = z
|
||||
... ''')
|
||||
>>> parser.scope.get_defined_names()
|
||||
>>> parser.module.get_defined_names()
|
||||
[<Name: a@2,0>, <Name: b@3,0>]
|
||||
|
||||
Note that unlike :meth:`get_set_vars`, assignment to object
|
||||
attribute does not change the result because it does not change
|
||||
the defined names in this scope.
|
||||
|
||||
>>> parser.scope.get_set_vars()
|
||||
>>> parser.module.get_set_vars()
|
||||
[<Name: a@2,0>, <Name: b@3,0>, <Name: b.c@4,0>]
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user