Marc-Andre Lemburg <[email protected]> added the comment: Eric Smith wrote: > > Eric Smith <[email protected]> added the comment: > > The more I think about this, the more concerned I am about changing the > number of elements in the tuple. That's the change that broke platform.py. > Maybe we should add a parameter named something like "level", defaulting to 0. > > 0 = existing behavior, but with named tuple > 1 = return named 9-tuple OSVERSIONINFOEX values > other values: reserved for future use > > Or maybe we should make it a bool instead, and not worry about future > expansion.
The usual approach to such problems is keeping the number of tuple items and their order the same and only add new items as additional attributes to the struct. See the CodecInfo tuple in codecs.py for an example on how this is done. The tuple is still a 4-tuple, but it provides access to more items via named attributes. ---------- nosy: +lemburg _______________________________________ Python tracker <[email protected]> <http://bugs.python.org/issue7766> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
