Re:Static types in Python
by clusmore on Thursday October 13, 2016 @09:47PM
(#12705648)
Pasting the relevant snippet from your link:
Wow, hadn't seen this before. That's exactly what I mean. If I can define my own, e.g. Addable, which does a similar check for the presence of __add__ (and __radd__) and MyPy uses the subclasshook, then that'd be perfect.
[ Parent
| on HN ]