On Fri, Mar 9, 2012 at 8:55 AM, Bryan Van de Ven <[email protected]>wrote:
> Hi all, > > I have started working on a NEP for adding an enumerated type to NumPy. > It is on my GitHub: > > https://github.com/bryevdv/numpy/blob/enum/doc/neps/enum.rst > > It is still very rough, and incomplete in places. But I would like to > get feedback sooner rather than later in order to refine it. In > particular there are a few questions inline in the document that I would > like input on. Any comments, suggestions, questions, concerns, etc. are > very welcome. > This looks like a great start to me. I think the open/closed enum distinction will need to be explored a little bit more, because it interacts with dtype immutability/hashability. Do you know if there are any examples of Python objects in the wild that dynamically convert from not being hashable (i.e. raising an exception if used as a dict key) to become hashable? It might be worth adding a section which briefly compares and contrasts the proposed functionality with enums in various programming languages. Here are two links I found to try and get an idea: MS on C# enum usage: http://msdn.microsoft.com/en-us/library/cc138362.aspx Wikipedia on C++ enum class: http://en.wikipedia.org/wiki/C%2B%2B11#Strongly_typed_enumerations For example, the C# enum has a way to enable a "flags" mode, which will create successive powers of 2. This may not be a feature NumPy needs, but if people are finding it useful in C#, maybe it would be useful here too. Cheers, Mark > > Thanks, > > Bryan > _______________________________________________ > NumPy-Discussion mailing list > [email protected] > http://mail.scipy.org/mailman/listinfo/numpy-discussion >
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
