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

List:       python-list
Subject:    Re: PEP 354: Enumerations in Python
From:       greg <greg () cosc ! canterbury ! ac ! nz>
Date:       2006-03-01 9:28:36
Message-ID: 46l8jtFbnfgeU5 () individual ! net
[Download RAW message or body]

Dan Sommers wrote:

> In some parts of the world, calendar weeks begin on Monday
> and end on Sunday, and in other parts of the world, work weeks begin on
> Sunday and end on Thursday.

Things like days of the week really have a circular
ordering, so it doesn't inherently make sense to
ask whether one day of the week is less than or
greater than another.

Maybe there should be a circular_enum type, where
order comparisons even among the *same* type are
disallowed?

Another thought -- should enum values have pred()
and succ() methods, like in Pascal? If so, for
a circular_enum these should wrap around.

--
Greg
-- 
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