On Fri, Dec 27, 2019 at 1:23 PM Marco Sulla via Python-ideas <python-ideas@python.org> wrote: > I propose to introduce for sequences the methods `indexes()` and `entries()`. >
"Sequence" is a protocol, not a class. Adding a method to sequences actually means mandating that everything that calls itself a sequence now has to implement this. Far better to create it as a stand-alone function - and for that, enumerate() is usually fine (esp since it handles arbitrary iterables, not just sequences). ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PZEXXT5D5KHLCLXOX5LAQPENJPXK24YR/ Code of Conduct: http://python.org/psf/codeofconduct/