On Tue, Nov 30, 2010 at 7:36 AM, Greg Ewing <greg.ewing at 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 | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4