>> 1. Have structseq subclass from PyTupleObject so that isinstance(s, tuple) >> returns True. This makes the object usable whenever >> tuples are needed. > > Hmm, is that really necessary? structseq has been in use for quite a > while and this need hasn't come up -- it's been designed to be quite > compatible with tuple *except* for isinstance checks, and that has > worked well.
It looks like that is the only difference, so subclassing from tuple won't cause any other behavioral changes. It looks like making it a subtype involves only changing a few lines. I think it can only help, especially if we start to use structseq for more things in the future. Also, I would like the API to match collections.namedtuple() as closely as possible so that there is just a single useful concept that gets applied whereever needed. The idea is basically that they *are* tuples with the added nicity of attribute access and a self-documenting repr. Raymond _______________________________________________ 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