[Python-Dev] PEP 443 Accepted

Łukasz Langa lukasz at langa.pl
Wed Jun 5 09:56:08 CEST 2013


On 5 cze 2013, at 09:29, Markus Unterwaditzer <markus at unterwaditzer.net> wrote:

> As somebody who missed the discussion about it and right now took a quick look at the PEP, i ask myself how subclasses are handled, as i don't see anything about it in the PEP, just support for ABCs.
> 
> E.g if
> 
>    issubclass(Apple, Fruit)
> 
> And i call a function which has registered an implementation for the Fruits type with an object of type Apple, is this implementation used? I assume so, but as said, i don't see it mentioned anywhere.

Yes, this is the supported behaviour. The PEP briefly explains that "Where there is no registered implementation for a specific type, its method resolution order is used to find a more generic implementation."

As Nick noted, the reason the description is so brief is that this works just like calling methods.

-- 
Best regards,
Łukasz Langa

WWW: http://lukasz.langa.pl/
Twitter: @llanga
IRC: ambv on #python-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130605/d954bbea/attachment.html>


More information about the Python-Dev mailing list