Skip to content

gh-153569: Simplify tokenizer source views and reader ownership - #158849

Merged
pablogsal merged 7 commits into
python:mainfrom
pablogsal:tokenizer-source-api-cleanup
Oct 13, 2026
Merged

pablogsal merged 7 commits into
python:mainfrom
pablogsal:tokenizer-source-api-cleanup

Conversation

@pablogsal

@pablogsal pablogsal commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Move byte access, searches, and span views into the source API. Keep comment and trailing-statement scanning on offsets, copy formatted-string expression segments through span views, and use logical line spans for _tokenize column calculations.

Move the borrowed file handle and owned encoding into the reader so input state and its cleanup live together. Reuse the codec helper to create incremental decoders.

Follow-up to #153569.

@pablogsal
pablogsal force-pushed the tokenizer-source-api-cleanup branch from f36c44b to 7da4c7f Compare October 5, 2026 15:51
@pablogsal
pablogsal force-pushed the tokenizer-source-api-cleanup branch from 7da4c7f to ffb781d Compare October 5, 2026 16:11
@pablogsal
pablogsal marked this pull request as ready for review October 12, 2026 02:51
@pablogsal
pablogsal enabled auto-merge (squash) October 13, 2026 12:30
@pablogsal
pablogsal merged commit f892b11 into python:main Oct 13, 2026
51 of 52 checks passed
@pablogsal
pablogsal deleted the tokenizer-source-api-cleanup branch October 13, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant