On 5 cze 2013, at 09:29, Markus Unterwaditzer <markus@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