Yeah, Pyre supports them as well. Recursive type aliases were a much-requested feature, both for things like JSON and for tree-like data structures.
For what it's worth, pyright supports recursive type aliases specifically to handle cases like this.
There is an open issue in the mypy issue tracker that was created over six years ago: https://github.com/python/mypy/issues/731. It has over 250 upvotes, so I think it's safe to say that if someone were to implement this in mypy, they'd be a hero to many!
If someone wants to try to implement it in mypy, I'd be happy to provide tips and pointers from my experience in implementing this in pyright. It was a relatively complicated feature, and it took several tries to get it right.
-Eric
--
Eric Traut
Contributor to pylance & pyright
Microsoft Corp.
_______________________________________________
Typing-sig mailing list -- typing-sig@python.org
To unsubscribe send an email to typing-sig-leave@python.org
https://mail.python.org/mailman3/lists/typing-sig.python.org/
Member address: gohanpra@gmail.com
--