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

> It essentially allows the user to check if a class implements an interface, without explicitly inheriting ABC or Protocol.

Protocols don't need to be explicit superclasses for compile time checks, or for runtime checks if they opt-in with @runtime_checkable, but Protocols are also much newer than __subclass_hook__.



TIL, thanks!

(I love being wrong on HN, always learn something)




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

Search: