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 ethan.furman
Recipients alex, eric.smith, ethan.furman, ncoghlan
Date 2013-05-12.10:44:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368355466.2.0.338915809536.issue17959@psf.upfronthosting.co.za>
In-reply-to
Content
Another approach to handling this, and other, issues is to allow options to EnumMeta.  My original aenum code had the default Enum class as unordered, no duplicates allowed, non-indexable, etc., but then allowed options to be passed in such as DUPLICATES to allow duplicates, ORDERED to add the ge-gt-le-lt methods, INDEXED to add __index__, etc.

For the aliasing issue this method is more robust as placeholders are not required, and code like this will work:

class Physics(Enum):
    e = 2.81847
    pi = 3.141596
    tau = 2 * pi

To make that code work with placeholders is possible (I have it in aenum) but a major pain (I was about to remove it before my offer to help with ref435 was accepted).
History
Date User Action Args
2013-05-12 10:44:26ethan.furmansetrecipients: + ethan.furman, ncoghlan, eric.smith, alex
2013-05-12 10:44:26ethan.furmansetmessageid: <1368355466.2.0.338915809536.issue17959@psf.upfronthosting.co.za>
2013-05-12 10:44:26ethan.furmanlinkissue17959 messages
2013-05-12 10:44:25ethan.furmancreate