[Python-ideas] Structural type checking for PEP 484

Sven R. Kunze srkunze at mail.de
Thu Sep 10 18:20:35 CEST 2015


Got it. Thanks.

On 10.09.2015 05:40, Jukka Lehtosalo wrote:
> On Wed, Sep 9, 2015 at 2:16 PM, Sven R. Kunze <srkunze at mail.de 
> <mailto:srkunze at mail.de>> wrote:
>
>     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".
>
>
> I want to preserve compatibility with earlier Python versions (down to 
> 3.2), and this makes it impossible to add any new syntax. Also, there 
> is no need to add a keyword as there are other existing mechanisms 
> which are good enough, including base classes (as in the proposal) and 
> class decorators. I don't think that this will become a very commonly 
> used language feature, and thus adding special syntax for this doesn't 
> seem very important. My expectation is that structural subtyping would 
> be primarily useful for libraries and frameworks.
>
> Jukka

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150910/41ce9f8e/attachment.html>


More information about the Python-ideas mailing list