mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
add warning box to clarify Scope metadata only handles local variable
This commit is contained in:
parent
9f8e69b1b3
commit
dea7c20794
1 changed files with 8 additions and 0 deletions
|
|
@ -282,8 +282,16 @@ class Scope(abc.ABC):
|
|||
A scope has a parent scope which represents the inheritance relationship. That means
|
||||
an assignment in parent scope is viewable to the child scope and the child scope may
|
||||
overwrites the assignment by using the same name.
|
||||
|
||||
Use ``name in scope`` to check whether a name is viewable in the scope.
|
||||
Use ``scope[name]`` to retrieve all viewable assignments in the scope.
|
||||
|
||||
.. warning::
|
||||
This scope analysis module only analyzes local variable names and it doesn't handle
|
||||
attribute names; for example, given a.b.c = 1, local variable name ``a`` is recorded
|
||||
as an assignment instead of ``c`` or ``a.b.c``. To analyze the assignment/access of
|
||||
arbitrary object attributes, we leave the the job to type inference metadata provider
|
||||
coming in the future.
|
||||
"""
|
||||
|
||||
#: Parent scope. Note the parent scope of a GlobalScope is itself.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue