PEP 354: Enumerations in Python

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Feb 27 19:59:51 EST 2006


"Terry Reedy" <tjreedy at udel.edu> writes:
> "Steven D'Aprano" <steve at REMOVETHIScyber.com.au> wrote
>> A list is a container.
>
> I think it is misleading, if not wrong, to refer to Python
> collections as 'containers', 'boxes', or similar.  A object in a box
> cannot be in another disjoint box.  A object in a box cannot be in
> the box a second time.  But both 'cannot's are 'can's for Python
> objects in respect to Python collections.  So, bad metaphor.

Thanks. Earlier today I referred to my conceptual model for
enumerations as "container". I agree with you that should be amended
to "collection".

Since an empty enumeration is consistent with the "collection" idiom,
and has obvious behaviour, I see no problem changing the specification
to remove that restriction.

> To me, 'I can't think of a use for X' is insufficient reason to
> prohibit X in Python.

I'm finding that most of the changes I made to the specification
before submitting the initial draft were removing such
restrictions. I'm glad to see that continues :-)

-- 
 \        "Either he's dead or my watch has stopped."  -- Groucho Marx |
  `\                                                                   |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list