[Python-Dev] Sets are mappings?

Aahz aahz at pythoncraft.com
Wed Dec 21 17:04:32 CET 2005


On Wed, Dec 21, 2005, Michael Chermside wrote:
>
> So I have a counter-proposal. Let's NOT create a hierarchy of abstract
> base types for the elementary types of Python. (Even basestring feels
> like a minor wart to me, although for now it seems like we need
> it.) If the core problem is "how do you create a canonical ordering
> for objects that survives serialization and deserialization into a
> different VM?", then somehow abstract base types doesn't seem like
> the most obvious solution. And if that's not the problem we're trying
> to solve here, then what IS? Because I don't know of very many ACTUAL
> (as opposed to theoretical) use cases for abstract base classes of
> fundamental types.

You've got a good point, but the documentation issue still exists; that's
what I was more interested in.  Clearly lists, tuples, and strings are
sequences; clearly dicts are a mapping; the question is whether sets get
tossed in with dicts.  Overall, I think it's pretty clear that the answer
is "no", particularly given that sets don't support __getitem__().
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Don't listen to schmucks on USENET when making legal decisions.  Hire
yourself a competent schmuck."  --USENET schmuck (aka Robert Kern)


More information about the Python-Dev mailing list