On Apr 21, 2013, at 03:25 PM, Nick Coghlan wrote: >Agreed. I think the stdlib enum library should use __prepare__ and >iterate in definition order (since 2.x compatibility isn't of any >concern), while flufl.enum can use "sorted by name" as the iteration >order. > >An "order_by_name" keyword argument to __prepare__ in the stdlib >version could then allow the user to opt in to the flufl.enum >behaviour, while still using definition order by default.
Seriously, why all the extra complexity for something you'll never care about? You don't care about the exact contents of __repr__ as long as it's predictable. You don't really care about item iteration order either as long as it's defined. Sorting by attribute name fulfills both use cases *and* it's simple. Zen 3 FTW. -Barry _______________________________________________ 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