On 11/16/2017 04:22 AM, Ivan Levkivskyi wrote:
On 16 November 2017 at 07:56, Nick Coghlan wrote:

Jim also raised an important point that needs clarification at the spec
>> level: given multiple entries in "orig_bases" with __mro_entries__ methods,
>> do all such methods get passed the *same* orig_bases tuple? Or do they
receive partially resolved ones, such that bases listed before them have
>> already been resolved to their MRO entries by the time they run.

Yes, they all get the same initial bases tuple as an argument. Passing
> updated ones will cost a bit more and I don't think it will be needed
> (in the worst case a base can resolve another base by calling its
> __mro_entries__ manually).  I will clarify this in the PEP.

If the extra complexity is to:

> - given orig_bases, a method could avoid injecting bases already listed
>   if it wanted to
> - allowing multiple items to be returned provides a way to programmatically
>   combine mixins without having to define a new subclass for each combination

And each method is passed the same original tuple (without other methods' updates) then don't we end up in a situation where we can have duplicates base classes?

--
~Ethan~
_______________________________________________
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