[Python-Dev] PEP 544: Protocols

Ivan Levkivskyi levkivskyi at gmail.com
Mon Mar 20 14:19:52 EDT 2017


On 20 March 2017 at 19:07, Brett Cannon <brett at python.org> wrote:

> I'm overall very supportive of seeing something like this make it into
> Python to further strengthen duck typing in the language.
>

Thanks!


> Personally, I think even an abstract method should be properly typed.
>
[SNIP]
>
or raise NotImplementedError.
>

Yes, I think this is a reasonable requirement. (Also assuming unconditional
raise is a bottom type, raising body is properly typed).
Initially I thought a type checker could warn about invalid calls to
super(), but this complicates things, and indeed "explicit is better than
implicit".

--
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170320/34f824b1/attachment.html>


More information about the Python-Dev mailing list