3 ms·
It's really cool that optional, product and sum types are supported. Does it work correctly with abstract base classes as well? (I'm expecting yes, just checki
by masklinn 16y ago
It's really cool that optional, product and sum types are supported.
Does it work correctly with abstract base classes as well? (I'm expecting yes, just checking).
Could it work with structural types as well? That would strike me as "more pythonic", and I've always been surprised that no Python type-annotation scheme can handle structural specs (though abcs are a step in the right direction).
- andrewcooke 16y agoThanks. I assume it works with ABCs, but haven't actually tried it (I ran out of time and wanted to publish something as a first release this weekend). Structural types would make more sense for general use, but not for what the larger library was actually intended for (I think) so I never really looked in that direction (and I don't have any ideas on how to extend it to include them, either). I do have an idea for a kind of type matching across sum types which will be quite neat if it works...