How to type NodeNG.parent
#2017
Labels
Maintenance
Discussion or action around maintaining astroid or the dev workflow
NodeNG.parent
#2017
The above code almost meets all requirements we would have for
.parent
except for one. I'll list them in the hopes of getting any good ideas on how to fix this. Note that this uses the proposed PEP 696 as I saw no other way to even get this far without.Node
itself should not need any type parameters (because of its genericness) and should be useable without anyNodeNG.parent
should be aLocalsDictNode
LocalsDictNode.parent
should also be aLocalsDictNode
Module.parent
. That should beNone
.The above design almost meets that requirement except for that in
FunctionDef.method the second
reveal_typeshows
LocalsDictNode | None, which should be
LocalsDictNodeas we know that
node.parentisn't a
Moduleand therefore
node.parent.parentshould be
LocalsDictNode`./CC @cdce8p as you might have a good idea for this. Hopefully...
The text was updated successfully, but these errors were encountered: