[PEAK] sequenceOf should inherit from type?
Phillip J. Eby
pje at telecommunity.com
Wed Jun 2 01:00:43 EDT 2004
At 12:33 AM 6/2/04 -0400, Bob Ippolito wrote:
>Logically, wouldn't it make sense if sequenceOf(n) returned an object that
>inherited from type?
>I say this because I had some (ugly, hackish) code that did
>issubclass(foo.typeObject, SomeClass) and it worked just fine in every
>case I had, except for sequenceOf, which would throw an exception since
>it's just an instance (not even a new style one, at that).
Hm. Well, if I understand your use of typeObject correctly, you may be in
violation of its contract anyway. typeObjects are supposed to implement
one of the model.IType* interfaces (I don't recall the name of the
appropriate one right off). So, 'protocols.sequenceOf()' isn't really
going to cut it for most of what a feature expects of its typeObject.
With respect to protocols being type-ish, I'd have to point out that it's
not at all a requirement and don't see a reason to complicate Protocol,
Variation, SequenceProtocol, etc. by mixing in type-ishness or even forcing
them to be new-style. I intentionally made the base Protocol class
"classic" so that you could mix it in to another classic class if you had
need to, without forcing the result to be new-style.
More information about the PEAK