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

For doing "duck-typing" formally, you need Interfaces or Protocols, rather than checking from a shortlist of allowed types.

Here's a blog post [1] from this discussion on Django 3.2 [2] 10 days ago.

[1] https://glyph.twistedmatrix.com/2021/03/interfaces-and-proto...

[2] https://news.ycombinator.com/item?id=26710013



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: