[Python-ideas] PEP 484 (Type Hints) -- first draft round

Andrew Barnert abarnert at yahoo.com
Mon Jan 19 10:19:04 CET 2015

On Jan 19, 2015, at 0:59, Todd <toddrjen at gmail.com> wrote:
> On Jan 16, 2015 6:18 PM, "Guido van Rossum" <guido at python.org> wrote:
> >
> > <snip>
> I apologize if I missed this, but is there any support for duck-type hinting, that is somehow defining a type hint by what attributes or methods it has rather than by what it is a subclass of?  Or is this something that is being intentionally avoided?
I think you're asking about what's called the "protocols" sub-feature, which has been put off until post-3.5, and probably a separate PEP. See issue #11 on the tracker. As I understand it, the issue is unifying static typing protocols with ABCs that do the same thing with subclass hooks (and possibly other things like Zope's more complex feature).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150119/ca3a5ebc/attachment.html>

More information about the Python-ideas mailing list