<div>Anyway, if you're doing arithmetic on enums you're doing it wrong. </div><div class="mailbox_signature">—<br>Sent from <a href="https://www.dropbox.com/mailbox">Mailbox</a></div><br><br><div class="gmail_quote"><p>On Sun, May 19, 2013 at 4:55 AM, Nick Coghlan <span dir="ltr"><<a href="mailto:email@example.com" target="_blank">firstname.lastname@example.org</a>></span> wrote:<br></p><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><p>On Sun, May 19, 2013 at 4:41 PM, Raymond Hettinger
<br>> nicer repr" is worth "Sorry, I broke your tests, made your published
<br>> out of date, and slowed down your code."
<br><br>While the first two considerations are always potentially applicable
<br>when using enums, the latter should only be true for code that uses
<br>str() and repr() a lot. For other operations, int-based enums
<br>shouldn't add any more overhead than namedtuple does for tuples.
<br><br>I agree with basically everything you said, but I don't want "enums
<br>are slower than normal integers" to become a meme - there really
<br>shouldn't be a speed difference for any arithmetic operations when
<br>Nick Coghlan | email@example.com | Brisbane, Australia
<br>Python-Dev mailing list