On Fri, Dec 27, 2019 at 1:23 PM Marco Sulla via Python-ideas <[email protected]> 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 -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/PZEXXT5D5KHLCLXOX5LAQPENJPXK24YR/ Code of Conduct: http://python.org/psf/codeofconduct/
