Skip to content

gh-135621: Simplify TermInfo - #136916

Merged
ambv merged 3 commits into
python:mainfrom
encukou:gh-135621-simplify
Jul 21, 2025
Merged

gh-135621: Simplify TermInfo#136916
ambv merged 3 commits into
python:mainfrom
encukou:gh-135621-simplify

Conversation

@encukou

@encukouencukou commented Jul 21, 2025

Copy link
Copy Markdown
Member

_pyrepl.terminfo's terminfo parsing follows ncurses and does a bunch of unnecessary (and untested) work. It can be simplified:

  • Don't parse names, booleans, and numbers. (I hope I left enough code & comments to make it easy to add these if needed.)
  • Don't store the strings as a list; populate the dict directly.
  • Use struct.iter_unpack and string_table.find instead of for loops

@encukouencukou mentioned this pull request Jul 21, 2025
@ambv
ambv merged commit 28153fe into python:mainJul 21, 2025
52 checks passed
@ambvambv added the needs backport to 3.14 bugs and security fixes label Jul 21, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @encukou for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 21, 2025
(cherry picked from commit 28153fe)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
@bedevere-app

Copy link
Copy Markdown

GH-136925 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label Jul 21, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@encukou@ambv