8000 gh-78465: Fix error message for cls.__new__(cls, ...) where cls is not instantiable by serhiy-storchaka · Pull Request #135981 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-78465: Fix error message for cls.__new__(cls, ...) where cls is not instantiable #135981

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

serhiy-storchaka
Copy link
Member
@serhiy-storchaka serhiy-storchaka commented Jun 26, 2025

Previous error message suggested to use cls.new(), which obviously does not work. Now the error message is the same as for cls(...).

… is not instantiable

Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 26, 2025
@serhiy-storchaka serhiy-storchaka merged commit c45f4f3 into python:main Jun 27, 2025
46 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 27, 2025
… is not instantiable (pythonGH-135981)

Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
(cherry picked from commit c45f4f3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker c45f4f3ebe34529a8db3a7918e8dd2e9f7ce8e86 3.13

@bedevere-app
Copy link
bedevere-app bot commented Jun 27, 2025

GH-136030 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 security fixes label Jun 27, 2025
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jun 27, 2025
…ere cls is not instantiable (pythonGH-135981)

Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
(cherry picked from commit c45f4f3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented Jun 27, 2025

GH-136031 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jun 27, 2025
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jun 27, 2025
…ere cls is not instantiable (pythonGH-135981)

Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
(cherry picked from commit c45f4f3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Jun 27, 2025
…s is not instantiable (GH-135981) (GH-136030)

Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
(cherry picked from commit c45f4f3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Jun 27, 2025
…s is not instantiable (GH-135981) (GH-136031)

Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
(cherry picked from commit c45f4f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0