<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:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</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><raymond.hettinger@gmail.com> wrote:
<br>> nicer repr" is worth "Sorry, I broke your tests, made your published
<br>> examples
<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>using IntEnum.
<br><br>Cheers,
<br>Nick.
<br><br>--
<br>Nick Coghlan   |   ncoghlan@gmail.com   |   Brisbane, Australia
<br>_______________________________________________
<br>Python-Dev mailing list
<br>Python-Dev@python.org
<br>http://mail.python.org/mailman/listinfo/python-dev
<br>Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
<br></p></blockquote></div><br>