Chris Smith wrote: > > But this starts to look bad, because we used to have this nice property > called encapsulation. To work around that, we'd need to make one of a > few choices: (a) give up encapsulation, which isn't too happy; (b) rely > on type inference for this kind of stuff, and consider it okay if the > type inference system breaks encapsulation; or (c) invent some kind of > generic constraint language so that constraints like this could be > expressed without exposing field names. Choice (b) is incomplete, as > there will often be times when I need to ascribe a type to a parameter > or some such thing, and the lack of ability to express the complete type > system will be rather limiting. Choice (c), though, looks a little > daunting.
Damn the torpedoes, give me choice c! I've been saying for a few years now that encapsulation is only a hack to get around the lack of a decent declarative constraint language. Marshall -- http://mail.python.org/mailman/listinfo/python-list
