On Tue, Nov 30, 2010 at 7:36 AM, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote: > I don't see how the grouping can be completely separated > from the value-naming. If the named values are to be > subclassed from the base values, then you want all the > members of a group to belong to the *same* subclass. > You can't get that by treating each named value on its > own and then trying to group them together afterwards.
Note that my sample implementation cached the created types, so that (for example) there was only ever one "Named<int>" type (my implementation wasn't quite kosher in that respect, since functools.lru_cache has a non-optional size limit - setting maxsize to float('inf') deals with that). A grouping API would use either single or multiple inheritance to create members that supported both the naming aspects as well as the grouping aspects. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ 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