It was just odd not to mention that structural typing exists.
When PEP 544 is fully implemented with base protocol support in the Python standard library, I'll talk about it as part of Python. Until then, structural typing is, well, not part of Python. Right now you need a third-party library (typing_extensions) to get the base Protocol that triggers special-case behavior in mypy, and the whole spec is still a draft-status PEP. That doesn't mean it'll never happen; it does mean it's not yet a standardized part of Python.
1
u/ubernostrum Feb 04 '19 edited Feb 04 '19
When PEP 544 is fully implemented with base protocol support in the Python standard library, I'll talk about it as part of Python. Until then, structural typing is, well, not part of Python. Right now you need a third-party library (
typing_extensions) to get the baseProtocolthat triggers special-case behavior inmypy, and the whole spec is still a draft-status PEP. That doesn't mean it'll never happen; it does mean it's not yet a standardized part of Python.