mypy
effd970a - Adds ability to have subclasses for NodeVisitor and TraverserVisitor (#10125)

Commit
5 years ago
Adds ability to have subclasses for NodeVisitor and TraverserVisitor (#10125) Currently a very important tool - which `NodeVisitor` definitely is - is not available to be used in a 3rd party code. Because currently inheriting from `NodeVisitor` raises an exception: `TypeError: interpreted classes cannot inherit from compiled traits` A developer has a single choice to replicate the same visitor pattern by themselves, which is not really convenient. So, I propose to make this consistent with `TypeVisitor`, which already allows having interpreted subclasses. Refs https://github.com/python/mypy/commit/a9fa9ab43a2655cf81c66c065d51db4618839d05 Refs https://github.com/python/mypy/issues/9001 Refs https://github.com/python/mypy/pull/9602
Author
Parents
Loading