-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
stubs: incompleteAnnotations or sub-modules missing from an existing package or moduleAnnotations or sub-modules missing from an existing package or module
Description
It looks like the stubs for jinja2 are missing attributes for its node objects.
For example, this works fine:
import jinja2
import jinja2.nodes
template = jinja2.Environment().parse('{{ foo.bar }}')
nodes = list(template.iter_child_nodes())
nodes = list(nodes[0].iter_child_nodes())
node = nodes[0]
assert isinstance(node, jinja2.nodes.Getattr)
print(node.attr)
print(node.node)
but mypy says:
x.py:9: error: "Getattr" has no attribute "attr"
x.py:10: error: "Getattr" has no attribute "node"
because of:
typeshed/third_party/2and3/jinja2/nodes.pyi
Lines 160 to 164 in b2cd972
class Getattr(Expr): | |
fields: Any | |
def as_const(self, eval_ctx: Optional[Any] = ...): ... | |
def can_assign(self): ... | |
Metadata
Metadata
Assignees
Labels
stubs: incompleteAnnotations or sub-modules missing from an existing package or moduleAnnotations or sub-modules missing from an existing package or module