5 ms·
Python can actually do (some) dependent types with generics but it's not pretty. The only real use-case that is both possible and worthwhile I've found is bein
by Spivak 4y ago
Python can actually do (some) dependent types with generics but it's not pretty.
The only real use-case that is both possible and worthwhile I've found is being able to say a value is a T if there's a default and an Optional[T] otherwise.
- still_grokking 4y ago> Python can actually do (some) dependent types with generics Could you show some examples?