On Wed, 14 Apr 2021 10:12:19 +1000 Hugh Fisher email@example.com wrote:
For example, type equivalence by name only is used in Ada (or was, it's been many years) and probably other languages. In equivalence by name, the following code would not pass the type checker. x : list[int] y : list[int] x = y # Type error
But I'm not aware of anyone implementing type by name equivalence for Python, and the original PEP 483 seems to explicitly close off that possibility. Instead the assumption seems to be Java/C++ structural equivalence for types.
Can you explain why you think C++ typing is based on structural equivalence?