Skip to content

Commit

Permalink
Tighten the metadata type of ExpressionContextProvider (Instagram#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
MapleCCC authored Aug 29, 2022
1 parent ea24906 commit 64811b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libcst/metadata/expression_context_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,17 @@ def visit_Param(self, node: cst.Param) -> Optional[bool]:
return False


class ExpressionContextProvider(BatchableMetadataProvider[Optional[ExpressionContext]]):
class ExpressionContextProvider(BatchableMetadataProvider[ExpressionContext]):
"""
Provides :class:`ExpressionContext` metadata (mimics the `expr_context
<https://docs.python.org/3/library/ast.html>`__ in ast) for the
following node types:
:class:`~libcst.Attribute`, :class:`~libcst.Subscript`,
:class:`~libcst.StarredElement` , :class:`~libcst.List`,
:class:`~libcst.Tuple` and :class:`~libcst.Name`.
Not that a :class:`~libcst.Name` may not always has context because of the differences between
Note that a :class:`~libcst.Name` may not always have context because of the differences between
ast and LibCST. E.g. :attr:`~libcst.Attribute.attr` is a :class:`~libcst.Name` in LibCST
but a str in ast. To honor ast implementation, we don't assignment context to
but a str in ast. To honor ast implementation, we don't assign context to
:attr:`~libcst.Attribute.attr`.
Expand Down

0 comments on commit 64811b7

Please sign in to comment.