On Tue, Apr 20, 2021 at 10:03 AM Mark Shannon <m...@hotpy.org> wrote:

> ...
> PEP 544 supports structural typing, but to declare a structural type you
> must inherit from Protocol.
> That smells a lot like nominal typing to me.
>

Note that to implement a protocol you do not have to inherit from anything.
You create a structural type that subclasses Protocol, but then any object
that satisfies that protocol can be passed where that type is expected,
without having to inherit anything, so I would argue that this really is
structural typing.


-- 
- eric casteleijn (he/him)
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/R3VP4KORAWI6KK4CNFL6JNYCATWR47EV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to