Raymond Hettinger <python <at> rcn.com> writes: > > [Fred Drake] > > I'd be happy seeing these methods added to tuple; there's > > no reason that they would only be useful on mutable sequences. >
Note that adding index and count to tuple will conflict with using these names as attributes in classes generated by collections.namedtuple. There is certain elegance in tuples and numbers having no non- special methods. What is the advantage of having count and index in Sequence ABC? These methods are easily implementable as functions that take an iterable (in fact, itertools.count already exists) and having them in Sequence ABC puts an extra burden on implementors of concrete classes. _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com