You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are all the functions of str (and bytes too) that could get tuple support like str.startswith() & str.endswith().
I think it would be most useful for str.find(), str.rfind(), str.rsplit() & str.split().
This would improve some code in the stdlib and would also benefit end users.
Note: I'm no longer getting a reponse on Discourse (and the followup thread was merged).
There was no support for the idea on Discourse. The purpose of the discussion is to find support before adding clutter to the issue tracker. If sentiment changes on Discourse, this issue can be reopened.
I have permission from @pfmoore to submit a PR and see if it gets accepted or rejected:
One other option is for someone just to submit one or more PRs implementing the proposed feature(s). The PRs will either get accepted or rejected, and then you have your answer. The lack of response might just be because there’s not a lot that’s interesting to say.
I don’t personally think this is worth the effort to implement, and I’m not convinced I’d find it very useful in practice. But I also don’t think it’s such a big deal that it needs a big debate, or communty consensus, or a PEP. So if you want to put in the effort, just go for it.
Feature or enhancement
Proposal:
These are all the functions of
str
(andbytes
too) that could get tuple support likestr.startswith()
&str.endswith()
.I think it would be most useful for
str.find()
,str.rfind()
,str.rsplit()
&str.split()
.This would improve some code in the stdlib and would also benefit end users.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
Linked PRs
find
,index
,rfind
&rindex
#119501The text was updated successfully, but these errors were encountered: