Paul Rubin wrote:

> Ben Finney <[EMAIL PROTECTED]> writes:
> 
>>Enumerations with no values are meaningless.  The exception
>>``EnumEmptyError`` is raised if the constructor is called with no
>>value arguments.
> 
> 
> Why are empty enumerations not allowed?  Empty sets, empty lists,
> empty dictionaries are all allowed.  I don't see any obvious benefits
> to not allowing empty enumerations.

What is an empty enum? How and when would you use it?

The best I can come up with is that an empty enum would 
be the enumerated values you have when you don't 
actually have any enumerated values. This is not to be 
confused with an empty list: an empty list is a 
well-defined concept. It is just a list (a container) 
with nothing in it. A list of X is like a box 
containing X, and like boxes, an empty list (or set, or 
dict) is meaningful. An enum of X is just the Xs 
themselves. If there is no X, there is nothing there.

But if you have a good usage case for an empty enum, 
please feel free to tell us.


-- 
Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to