Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> What I can’t understand is the argument that occasional use of `isinstance` is bad, but also that pervasive nominal type-checking via annotations is good.

it doesn't have to be nominal, MyPy supports structural sub-typing through Protocols [1]

[1] https://mypy.readthedocs.io/en/stable/protocols.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: