Making immutable instances
Ben Finney
bignose+hates-spam at benfinney.id.au
Thu Dec 1 21:42:31 EST 2005
Mike Meyer <mwm at mired.org> wrote:
> Ben Finney <bignose+hates-spam at benfinney.id.au> writes:
> > Mike Meyer <mwm at mired.org> wrote:
> >> Lots of people seem to want immutable instances. Nobody seems to
> >> have a use case for them.
> > Perhaps you missed my release announcement of the 'enum' package
> > that explains why Enum instances are immutable.
>
> Yes, I did. I couldn't turn it up in Google, either.
It was the announcement for enum 0.3:
<URL:http://groups.google.com/group/comp.lang.python/browse_thread/thread/ea5991de0459d5c4/>
> Could I get you to recap the reason?
"Since the values of an enumeration are directly reflected in the
values and attributes, Enum instances are immutable to preserve
this relationship"
--
\ "I can picture in my mind a world without war, a world without |
`\ hate. And I can picture us attacking that world, because they'd |
_o__) never expect it." -- Jack Handey |
Ben Finney
More information about the Python-list
mailing list