This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pekka.klarck
Recipients BNMetrics, gvanrossum, josh.r, pablogsal, pekka.klarck, rhettinger, xtreak
Date 2019-09-13.09:28:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1568366917.2.0.0882450034214.issue34805@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-09-13 09:28:37pekka.klarcksetrecipients: + pekka.klarck, gvanrossum, rhettinger, josh.r, pablogsal, xtreak, BNMetrics
2019-09-13 09:28:37pekka.klarcksetmessageid: <1568366917.2.0.0882450034214.issue34805@roundup.psfhosted.org>
2019-09-13 09:28:37pekka.klarcklinkissue34805 messages
2019-09-13 09:28:37pekka.klarckcreate