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

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

Reply via email to