You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the type hint for the self.stack attribute of class TypingCollector is wrong and should read
classTypingCollector(cst.CSTVisitor):
def__init__(self):
# stack for storing the canonical name of the current functionself.stack: List[str] = []
...
instead of
classTypingCollector(cst.CSTVisitor):
def__init__(self):
# stack for storing the canonical name of the current functionself.stack: List[Tuple[str, ...]] = [] # wrong type hint
...
because the only assignment to self.stack in the example is
...
self.stack.append(node.name.value)
...
and node.name.value is a str, not a Tuple.
The error will also be flagged by pyright or mypy.
The same applys to class TypingTransformer in the same file.
The text was updated successfully, but these errors were encountered:
In
docs/source/tutorial.ipynb
the type hint for the
self.stack
attribute ofclass TypingCollector
is wrong and should readinstead of
because the only assignment to
self.stack
in the example isand
node.name.value
is astr
, not aTuple
.The error will also be flagged by pyright or mypy.
The same applys to
class TypingTransformer
in the same file.The text was updated successfully, but these errors were encountered: