Pekka Klärck <pekka.kla...@gmail.com> added the comment:

First of all, thanks Raymond for the revival. Secondly, I agree with Josh that 
there are better ways to handle my original use case (e.g. 
`functools.singledispatch`) but `__subclasses__()` preserving the definition 
order could nevertheless be useful in other cases.

The main reason I proposed this issue was to get the behavior documented one 
way or the other. I'd prefer the current behavior if it doesn't cause any/much 
extra work nor or later. It's hard for me to see why subclasses weren't stored 
in a dict in the future, but problem assigning to `__bases__` pointed out by 
Josh might be worth a though. Not sure is it OK to just consider this kind of 
side effects OK in such a niche case, should the related code be changed, or is 
this big enough problem to prevent preserving subclass order in the first place.

Anyway, if the decision is to preserve the order, I'd say a test making sure 
the order is actually preserved would be needed in addition to the doc change. 
If the decision is to keep the order undefined, then the docs should preferably 
be updated anyway to make the situation clear.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34805>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to