<div dir="ltr"><div><div><div><div><div><div>Hi, about this enum/const thing, The use case I like more is a class where you know all the<br>instances and not just a sequence of names.<br></div>Particularly It would be nice to have custom attributes and methods besides the value and the name.<br>

<br></div>I have my own implementation with a basic api somewhat borrowed from flufl.enum (plus a lot of other stuff),<br>but with this kind of support: <a href="https://github.com/jbvsmo/makeobj">https://github.com/jbvsmo/makeobj</a><br>

</div><div></div><div><br></div>I couldn't find the best way to express enums with the current python syntax, so I also wrote a simple<br></div>regex-parsed language to fit objects with an arbitrary level of complexity. I think, enumeration per se<br>

</div>is not much more useful than just a bunch of integers... Having this kind of control IMO is.<br><br></div>Although Java is not a good example of anything, they have a similar feature. What do you people think?<br></div>

<div class="gmail_extra"><br clear="all"><div>Joćo Bernardo</div>
<br><br><div class="gmail_quote">2013/2/3 Tim Delaney <span dir="ltr"><<a href="mailto:timothy.c.delaney@gmail.com" target="_blank">timothy.c.delaney@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra"><div class="im">On 4 February 2013 08:39, Tim Delaney <span dir="ltr"><<a href="mailto:timothy.c.delaney@gmail.com" target="_blank">timothy.c.delaney@gmail.com</a>></span> wrote:<br>

</div><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><span style="color:rgb(34,34,34)">Public repository on BitBucket: </span><a href="https://bitbucket.org/magao/enum" target="_blank">https://bitbucket.org/magao/enum</a><br>


</div></div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Feel free to raise issues there, clone and make pull requests, etc.</div></div></div></div></blockquote><div><br></div></div>As Eli has noted in the issues, no comments or anything except the unit tests yet. Lots of magic. Needs significant cleanup.<div>


<br></div><div>And I'll note again in case it's not clear - this currently *only* works with Python 3.3.<span class="HOEnZb"><font color="#888888"><br><div><br></div><div>Tim Delaney</div></font></span></div><div>

 </div></div></div></div>
<br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br></blockquote></div><br></div>