FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-110050: Adjust the newline position in the TypeError message of the random.seed call. by yilei · Pull Request #110051 · python/cpython · GitHub

/ cpython Public

gh-110050: Adjust the newline position in the TypeError message of the random.seed call. - #110051

Merged
ambv merged 4 commits into
python:mainfrom
yilei:random
Oct 10, 2023
Merged

gh-110050: Adjust the newline position in the TypeError message of the random.seed call.#110051
ambv merged 4 commits into
python:mainfrom
yilei:random

Conversation

yilei commented Sep 28, 2023
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

The newline was intentional. Without it, the error line is 90 characters which is too long:

>>> len('TypeError: The only supported seed types are: None, int, float, str, bytes, and bytearray.')
90

That said, it might be nice to move the newline to just before the None giving a more natural line break.

yilei commented Sep 29, 2023
edited
Loading

Copy link
Copy Markdown
Contributor Author

Ah OK, this is a strange convention to me, since in many cases you can't control the length of the message when it also includes strings formatted from other variables. Also, the file names in the trackeback are usually already much longer.

That said, I updated this PR to just adjust the newline position.

Thanks for the review!

yilei changed the title gh-110050: Use a space instead of newline in the TypeError message of the random.seed call. gh-110050: Adjust the newline position in the TypeError message of the random.seed call. Sep 29, 2023
ambv merged commit ce43d5f into python:main Oct 10, 2023

Copy link
Copy Markdown
Contributor

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 10, 2023
… of the random.seed call. (pythonGH-110051)

(cherry picked from commit ce43d5f)

Co-authored-by: Yilei Yang <hi@mangoumbrella.com>
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

bedevere-app Bot commented Oct 10, 2023

Copy link
Copy Markdown

GH-110625 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 10, 2023
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
… of the random.seed call. (python#110051)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
yilei deleted the random branch March 12, 2026 15:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL