Python 3.14 REPL blanks links above terminal rows when pasting
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
In Python 3.14 beta 2, pasting code that has more lines than the height of my terminal window will result in the lines just above the terminal window being blank.
To reproduce:
- Resize your terminal so the height is approximately 20 rows
- Paste the below block of Python code.
- Scroll up in your terminal to see previous lines above the last 20 rows
- Note that all rows above the terminal screen are blank (no
class Point:line or__slots__line for example)
class Point:
__slots__ = ('x', 'y')
__match_args__ = ('x', 'y')
def __init__(self, x: float, y: float) -> None:
object.__setattr__(self, 'x', x)
object.__setattr__(self, 'y', y)
def __repr__(self):
cls = type(self).__name__
return f'{cls}(x={self.x!r}, y={self.y!r})'
def __eq__(self, other):
if not isinstance(other, Point):
return NotImplemented
return (self.x, self.y) == (other.x, other.y)
def __hash__(self):
return hash((self.x, self.y))
def __setattr__(self, name, value):
raise AttributeError(f"Can't set attribute {name!r}")
def __delattr__(self, name):
raise AttributeError(f"Can't delete attribute {name!r}")
def __getstate__(self):
return (self.x, self.y)
def __setstate__(self, state):
fields = ('x', 'y')
for field, value in zip(fields, state):
object.__setattr__(self, field, value)
This is essentially the same as the "Blank lines" section of issue #119517.
I assume this is being done for performance reasons, but this is going to make my life harder when teaching. I often use a large font when teaching, so it's not uncommon that I'll paste a block of code that is longer than the terminal height. Being able to scroll up and show my students what was pasted is an essential feature for me when teaching.
CPython versions tested on:
3.14
Operating systems tested on:
Linux
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue に貼り付けられた例を使用して、約20行にリサイズした Linux ターミナルで Python 3.14 REPL の動作を再現します。関連するコンテキストについて issue #119517 の「Blank lines」セクションを読み、その後、ターミナルのビューポートより上にある貼り付けた行が上にスクロールして戻ったときにも表示されたままであることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100