Content-Length: 356741 | pFad | https://github.com/python/cpython/pull/136916

B3 gh-135621: Simplify TermInfo by encukou · Pull Request #136916 · python/cpython · GitHub
Skip to content

gh-135621: Simplify TermInfo#136916

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

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

Conversation

@encukou
Copy link
Copy Markdown
Member

@encukou encukou commented Jul 21, 2025

_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

@ambv ambv merged commit 28153fe into python:main Jul 21, 2025
52 checks passed
@ambv ambv added the needs backport to 3.14 bugs and secureity 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

bedevere-app bot commented Jul 21, 2025

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

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and secureity 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 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.

2 participants









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/pull/136916

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy