[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: PEP 354: Enumerations in Python
From:       "Terry Reedy" <tjreedy () udel ! edu>
Date:       2006-02-28 19:26:49
Message-ID: du285o$ub1$1 () sea ! gmane ! org
[Download RAW message or body]


"Stefan Rank" <stefan.rank@ofai.at> wrote in message 
news:440415A1.7070503@ofai.at...
> recent examples from this list:
>
> 2006-01-03: http://www.nabble.com/Re%3A-Regex-anomaly-p2179421.html
> 2006-02-20:
> http://www.nabble.com/Re%3A-Regular-expression-gone-mad-p3029028.html

If the re flags were implemented as instances of object instead of int,
then misuse of them as int args would be excepted.  I don't know if such a 
change would otherwise cause a problem.

I wonder whether a subclass of object (EnumSet?) that allowed for 
initialization with a better string representation and that disabled order 
comparisons would fill the bill for unordered enum.

As Steven Bethard also noted, there seem to be a need for two Enum 
subclasses:
EnumSet and EnumSeq.

Terry Jan Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic