[Python-ideas] Structural type checking for PEP 484

Sven R. Kunze srkunze at mail.de
Wed Sep 9 23:16:24 CEST 2015


Thanks for sharing, Guido. Some random thoughts:

- "classes should need to be explicitly marked as protocols"
If so, why are they classes in the first place? Other languages has 
dedicated keywords like "interface".

- "recursive types"?
Yes, please. I am very curious about how to as I am working a similar 
problem. It would basically require defining of the protocol first and 
then populating its member as they might use the protocol's name. pyfu 
is supposed to do exactly this. But it's not going to work 100% when 
metaclasses come into the game.

Best,
Sven

On 09.09.2015 22:17, Guido van Rossum wrote:
> Jukka wrote up a proposal for structural subtyping. It's pretty good. 
> Please discuss.
>
> https://github.com/ambv/typehinting/issues/11#issuecomment-138133867
>
> -- 
> --Guido van Rossum (python.org/~guido <http://python.org/%7Eguido>)
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150909/4c253091/attachment.html>


More information about the Python-ideas mailing list