Growing pains for typing in Python
Growing pains for typing in Python
Posted Jan 18, 2024 6:22 UTC (Thu) by benhoyt (subscriber, #138463)In reply to: Growing pains for typing in Python by warrax
Parent article: Growing pains for typing in Python
In statically typed languages like O'Caml and Go, the related concept is called "structural typing" and not "duck typing". In Python with type annotations, structural typing (statically checked) is supported with PEP 544 "protocols". [3]
See also the sections on typing in the Wikipedia articles about Python [4] and O'Caml [5].
[1] https://groups.google.com/g/comp.lang.python/c/CCs2oJdyuz...
[2] https://docs.python.org/3/glossary.html#term-duck-typing
[3] https://docs.python.org/3.8/library/typing.html#nominal-v...
[4] https://en.wikipedia.org/wiki/Python_(programming_language)#Typing
[5] https://en.wikipedia.org/wiki/OCaml#Features
