GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-153569: Replace tokenizer input readers by pablogsal · Pull Request #156472 · python/cpython

Conversation

@pablogsal

@pablogsal pablogsal commented Aug 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This gets rid of the four separate tokenizer input implementations and replaces them with one reader and decoder pipeline. Files, strings, readline callbacks, and interactive input now share encoding detection, incremental decoding, newline handling, and cleanup, so the duplicated reader state and helpers go away. Complete UTF-8 callback lines skip incremental codec setup, while split and stateful input keeps the decoder state it needs. Interactive input keeps the source it needs without making the other readers retain a second copy.

This is the next part of #153569.

  • Issue: Base the tokenizer API on source offsets #153569

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zooba reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@pablogsal
pythongh-153569: replace tokenizer input readers
be46fa5
@pablogsal
pablogsal requested review from a team, AA-Turner, emmatyping, ericsnowcurrently, erlend-aasland, itamaro and lysnikolaou as code owners August 27, 2026 14:36
@bedevere-app bedevere-app Bot mentioned this pull request Aug 27, 2026
Base the tokenizer API on source offsets #153569
Open
@bedevere-app bedevere-app Bot added the awaiting core review label Aug 27, 2026
@pablogsal
pythongh-153569: preserve unterminated interactive input
adf62b2
@pablogsal pablogsal mentioned this pull request Aug 27, 2026
gh-153569: return token spans and unify decoded source storage #156482
Merged
@pablogsal
pythongh-153569: fix tokenizer includes in external builds
19d3ba4
@pablogsal pablogsal added the skip news label Aug 27, 2026
pablogsal added 2 commits August 27, 2026 19:39
@pablogsal
pythongh-153569: avoid retaining duplicate reader input
dea35e4
@pablogsal
pythongh-153569: speed up UTF-8 readline decoding
12a9a35
@pablogsal
pablogsal merged commit f5dbcba into python:main Aug 28, 2026
60 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@pablogsal
pablogsal deleted the gh-153569-tokenizer-reader-cutover branch August 28, 2026 15:26
@bedevere-app bedevere-app Bot removed the awaiting core review label Aug 28, 2026
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@pablogsal @clin1234
pythongh-153569: Unify tokenizer input readers (python#156472)
5d10a5c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou is a code owner
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner
@itamaro itamaro Awaiting requested review from itamaro itamaro is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@pablogsal
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.