-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-118184: Support tuples for find
, index
, rfind
& rindex
#119501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
3632624
Support tuples for `find` & `rfind`
nineteendo e39b040
Update docs
nineteendo cb905bc
Add tests
nineteendo 1807fd8
📜🤖 Added by blurb_it.
blurb-it[bot] cca08fa
Apply suggestions from code review
nineteendo 302faa3
Apply suggestions from code review
nineteendo cb95578
Fix signature tests
nineteendo a35d3ae
Short circuit
nineteendo 65c0a9e
Fix start for `rfind`
nineteendo 5cbb1f0
Refactor checks
nineteendo 00b2b04
Fix end for `rfind`
nineteendo e124603
Adjust indices
nineteendo 41b0cd8
Micro optimisation
nineteendo 7b83a22
Fix conversion
nineteendo c905458
Fix condition
nineteendo 5c79f24
Add tests
nineteendo 148b471
Clarify documentation
nineteendo 351dc83
Add constant
nineteendo ddaf4b4
Duplicate constant
nineteendo 2b044a1
Add tests
nineteendo a632f25
Remove newline
nineteendo ef28dab
Update Lib/test/string_tests.py
nineteendo 4207d54
Update Lib/test/string_tests.py
nineteendo 0dff482
Update Lib/test/string_tests.py
nineteendo fc0d9ea
Update Lib/test/string_tests.py
nineteendo cd317fd
Don't check twice on boundary
nineteendo 43e8259
Apply suggestions from code review
nineteendo 2524dc1
Apply suggestions from code review
nineteendo dbc8c94
Test bytes
nineteendo 49a28a0
Add more bytes tests
nineteendo 0bd606d
Support tuples for index & rindex
nineteendo b337fdc
Update Objects/bytes_methods.c
nineteendo e43373f
Update Misc/NEWS.d/next/Core and Builtins/2024-05-24-11-07-16.gh-issu…
nineteendo b47b0e0
Update docs
nineteendo 6f71b39
Refactor code
nineteendo 64ef311
Fix error message
nineteendo a116f33
Add asserts
nineteendo e29828d
Remove unnecessary check
nineteendo a85f84a
Revert "Remove unnecessary check"
nineteendo ac19e87
Optimise length of 0 & 1
nineteendo b62e8b4
Avoid testing with tuples of 1 item
nineteendo b6492db
Simplify news.
nineteendo dd23e04
Fix indentation
nineteendo 38d2df8
Handle -2
nineteendo 223cb1b
Update Misc/NEWS.d/next/Core and Builtins/2024-05-24-11-07-16.gh-issu…
nineteendo bc29c92
Guard overflow
nineteendo f14ee7d
Tweak `FIND_CHUNK_SIZE`
nineteendo 3606e00
Refer to `re` & `regex`
nineteendo 9e2006c
Release buffer
nineteendo fb48c41
Release other buffer
nineteendo 308174c
Save lengths
nineteendo 6a3d651
malloc
nineteendo 3227e63
Fix malloc
nineteendo 70d673f
Store needles for bytes
nineteendo 7b205b3
Revert test
nineteendo 0664ced
Restructure code
nineteendo b132742
Fix smelly symbol
nineteendo 8189c66
Make static
nineteendo 53d3a07
Remove variable
nineteendo 648725d
Reverse comparison
nineteendo 4fe06fb
Add brackets
nineteendo 145f45d
Remove continue
nineteendo c96775c
2 arguments per line
nineteendo b4722c4
Exclude long needles
nineteendo 5c8751a
Include needles with a larger kind
nineteendo c219cf5
fast find for strings
nineteendo ccbfa0e
Fix argument type
nineteendo aada7f5
Rename argument
nineteendo 090ddee
Decrease diff
nineteendo 6b85fd7
Decrease diff 2
nineteendo 41a6c20
Decrease diff 3
nineteendo 460effa
Remove continue
nineteendo d1c4af6
Parentheses
nineteendo c19ddcf
Store converted needles on the heap
nineteendo 6beae49
cleanup
nineteendo ff514be
Fix uninitialised variable
nineteendo ff6eea2
Try to prevent segmentation fault
nineteendo 0cbf03a
Fix cast
nineteendo d412046
Revert "Fix cast"
nineteendo 168fe84
Revert "Try to prevent segmentation fault"
nineteendo 41b11e5
Uninitialised memory?
nineteendo ffe1152
More tests
nineteendo ac91f79
Rename parameter
nineteendo 6751992
Unnest
nineteendo 44aebd1
Keep buffers acquired during search
nineteendo 9a51fd9
Add `buffers_len`
nineteendo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/Core and Builtins/2024-05-24-11-07-16.gh-issue-118184.EK4di_.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Support tuples for :class:`str`, :class:`bytes` and :class:`bytearray` methods ``find()``, ``index()``, ``rfind()`` and ``rindex()``. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.