Message189067
| Author |
barry |
| Recipients |
barry, ethan.furman, ncoghlan |
| Date |
2013年05月12日.22:00:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<20130512180026.60377cd4@limelight.wooz.org> |
| In-reply-to |
<1368356222.14.0.0972295622627.issue17961@psf.upfronthosting.co.za> |
| Content |
On May 12, 2013, at 10:57 AM, Nick Coghlan wrote:
>I encountered an interesting suggestion [1] regarding the enum.Enum
>convenience API: use the member names as their values, rather than the
>current integers starting from one.
>
>Since we're now using definition order rather than value order for iteration,
>this suggestion makes a lot of sense to me.
Cute, but I want the functional API to be equivalent to the class syntax.
Besides:
X = Enum('X', ((name, name) for name in 'ant bee cat dog elk'.split()))
is not so much typing. |
|