Title: Add checking if both strings are the same in `SequenceMatcher.find_longest_match` · Issue #132166 · python/cpython · GitHub
Open Graph Title: Add checking if both strings are the same in `SequenceMatcher.find_longest_match` · Issue #132166 · python/cpython
X Title: Add checking if both strings are the same in `SequenceMatcher.find_longest_match` · Issue #132166 · python/cpython
Description: Feature or enhancement Proposal: Add checking if sequences a[alo:ahi] and b[blo:bhi] are the same on the beginning of the method find_longest_match in SequenceMatcher. For identical sequences there is no reason to run whole logic when si...
Open Graph Description: Feature or enhancement Proposal: Add checking if sequences a[alo:ahi] and b[blo:bhi] are the same on the beginning of the method find_longest_match in SequenceMatcher. For identical sequences there...
X Description: Feature or enhancement Proposal: Add checking if sequences a[alo:ahi] and b[blo:bhi] are the same on the beginning of the method find_longest_match in SequenceMatcher. For identical sequences there...
Opengraph URL: https://github.com/python/cpython/issues/132166
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add checking if both strings are the same in `SequenceMatcher.find_longest_match`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nAdd checking if sequences `a[alo:ahi]` and `b[blo:bhi]` are the same on the beginning of the method `find_longest_match` in `SequenceMatcher`. For identical sequences there is no reason to run whole logic when simple check can be done. It appears to fix issue when comparing two slightly different strings ends up with waiting forever for the result. This solves problem reported here https://github.com/pytest-dev/pytest/issues/8998 \n\nProposed fix:\n\n```python\nif a[alo:ahi] == b[blo:bhi]:\n return Match(alo, blo, len(a[alo:ahi]))\n```\n\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-132167\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/jurgenwigg","@type":"Person","name":"jurgenwigg"},"datePublished":"2025-04-06T17:14:40Z","url":"https://github.com/python/cpython/issues/132166"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:20c9d5d4-a1cc-becf-5fa6-709ba2d77b59 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 86B6:4BB79:430061D:5567F96:6B023A94 |
| html-safe-nonce | 1c30b20473d91b78f280369b2bba5e77ea614aeffd01de0de5bf70793888eb85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkI2OjRCQjc5OjQzMDA2MUQ6NTU2N0Y5Njo2QjAyM0E5NCIsInZpc2l0b3JfaWQiOiI0MzMyODY0MDcwNTgwNTgzMDYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fc7132095c38848938faa1d7bd32c7499a49f08eace196411d21f8e00dee5116 |
| hovercard-subject-tag | issue:2975080800 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/132166/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a641aa5d65390418628c8f5f6b4b4e86b9e16932d58ba5b3fb02fea8ece5144e/python/cpython/issues/132166 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a641aa5d65390418628c8f5f6b4b4e86b9e16932d58ba5b3fb02fea8ece5144e/python/cpython/issues/132166 |
| og:image:alt | Feature or enhancement Proposal: Add checking if sequences a[alo:ahi] and b[blo:bhi] are the same on the beginning of the method find_longest_match in SequenceMatcher. For identical sequences there... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jurgenwigg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width