Aahz wrote: > On Tue, Dec 20, 2005, M.-A. Lemburg wrote: >> Josiah Carlson wrote: >>> New superclasses for all built-in types (except for string and unicode, >>> which already subclass from basestring). >>> >>> int, float, complex (long) : subclass from basenumber >>> tuple, list, set : subclass from basesequence >>> dict : subclass from basemapping >> set should be under basemapping. > > Are you sure? Sets are not actually a mapping; they consist only of > keys. The Python docs do not include sets under maps, and sets do not > support some of the standard mapping methods (notably keys()). Raymond > Hettinger has also talked about switching to a different internal > structure for sets. > > (Should this discussion move to c.l.py? Normally I'd think so, but I > think it's critical that the core developers agree about this. It's > also critical for me to know because I'm writing a book, but that's not > reason enough to stick with python-dev. ;-)
Close enough to on-topic to stay here, I think. However, I tend to think of the taxonomy as a little less flat: basecontainer (anything with __len__) - set - basemapping (anything with __getitem__) - dict - basesequence (anything which understands x[0:0]) - list - tuple - string - unicode - basearray (anything which understands x[0:0,]) - Numeric.array/scipy.array Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com