(original) (raw)
On 21 April 2013 04:10, Barry Warsaw <barry@python.org> wrote:
On Apr 13, 2013, at 08:37 AM, Tim Delaney wrote:I think this isn't possible if we want to keep backward compatibility with
\>Just using definition order as the stable iteration order would do the
\>trick - no need for any comparisons at all. Subclasses (e.g. IntEnum) can
\>then override it.
earlier Pythons, which I want to do.
Do you want it compatible with Python 2.x? In that case I don't see a way to do it - getting definition order relies on \_\_prepare\_\_ returning an ordered dict, and \_\_prepare\_\_ of course is only available in 3.x.
Tim Delaney