Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.13] gh-138897: Use_pyrepl.pager for_sitebuiltins._Printer (GH-138898)#143365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ambv merged 1 commit intopython:3.13frommiss-islington:backport-0417dab-3.13
Jan 2, 2026
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletionsLib/_sitebuiltins.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@ def __init__(self, name, data, files=(), dirs=()):
import os
self.__name = name
self.__data = data
self.__lines =None
self.__lines =[]
self.__filenames = [os.path.join(dir, filename)
for dir in dirs
for filename in files]
Expand DownExpand Up@@ -65,24 +65,12 @@ def __repr__(self):
return "Type %s() to see the full %s text" % ((self.__name,)*2)

def __call__(self):
from _pyrepl.pager import get_pager
self.__setup()
prompt = 'Hit Return for more, or q (and Return) to quit: '
lineno = 0
while 1:
try:
for i in range(lineno, lineno + self.MAXLINES):
print(self.__lines[i])
except IndexError:
break
else:
lineno += self.MAXLINES
key = None
while key is None:
key = input(prompt)
if key not in ('', 'q'):
key = None
if key == 'q':
break

pager = get_pager()
text = "\n".join(self.__lines)
pager(text, title=self.__name)


class _Helper(object):
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
Improved :data:`license`/:data:`copyright`/:data:`credits` display in the
:term:`REPL`: now uses a pager.
Loading

[8]ページ先頭

©2009-2026 Movatter.jp