This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients nemeskeyd, steve.dower
Date 2021-09-23.15:55:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632412531.48.0.826578916656.issue45271@roundup.psfhosted.org>
In-reply-to
Content
Strings are already special in that str.index() and str.find() both find substrings, while list.index() only finds a single element.

If .find() also searched for a substring of the list, I think this could be helpful. Even more so if it used an efficient algorithm (bearing in mind that the arbitrary comparisons between elements - something else that doesn't exist in strings - would make this complicated).

This is probably something to bring up on the python-ideas mailing list first, anyway. Symmetry is not a sufficient reason in itself to add new APIs - often the asymmetry exists because the "missing" one is only there for legacy/compatibility reasons, not because it is a good API.
History
Date User Action Args
2021-09-23 15:55:31steve.dowersetrecipients: + steve.dower, nemeskeyd
2021-09-23 15:55:31steve.dowersetmessageid: <1632412531.48.0.826578916656.issue45271@roundup.psfhosted.org>
2021-09-23 15:55:31steve.dowerlinkissue45271 messages
2021-09-23 15:55:31steve.dowercreate