On Tue, 21 Apr 2015 at 09:59 Cory Benfield <c...@lukasa.co.uk> wrote:
[...]

> Further, Python's type system is not sufficiently flexible to allow
> library authors to adequately specify the types their code actually
> works on. I need to be able to talk about interfaces, because
> interfaces are the contract around which APIs are build in Python, but
> I cannot do that with this system in a way that makes any sense at
> all. To even begin to be useful for library authors this PEP would
> need to allow some kind of type hierarchy that is *not* defined by
> inheritance, but instead by interfaces. We've been discouraging use of
> 'type' and 'isinstance' for years because they break duck typing, but
> that has *nothing* on what this PEP appears to do to duck typing.
>
> This is why I feel like this PEP may be a real threat to duck typing.  If
people constantly get told by their editor / IDE that they are calling
function with the wrong argument types, what are they going to do?  They
may start adopting the same approach as in Java / C++ etc... where
interfaces must be explicitly defined and the practice of duck typing may
become forgotten because discouraged by the tools programmers use.

I guess what I'm saying is that this could encourage a very significant
cultural change in the way Python code is written towards a less flexible
mindset.

-- 
Arnaud
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to