Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ find_prefix_at_end
Function
find_prefix_at_end
Lib/test/support/asynchat.py:310–314 ·
view source on GitHub ↗
(haystack, needle)
Source
from the content-addressed store, hash-verified
308
# regex: 14035/s
309
310
def
find_prefix_at_end(haystack, needle):
311
l = len(needle) - 1
312
while
l and not haystack.endswith(needle[:l]):
313
l -= 1
314
return
l
Callers
1
handle_read
Method · 0.85
Calls
1
endswith
Method · 0.45
Tested by
no test coverage detected
Used in the wild
real call sites across dependent graphs
searching dependent graphs…