Skip to content

Improve the repr of partialmethod #121025

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

Closed
serhiy-storchaka opened this issue Jun 26, 2024 · 1 comment
Closed

Improve the repr of partialmethod #121025

serhiy-storchaka opened this issue Jun 26, 2024 · 1 comment
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Jun 26, 2024

Bug report

The repr of partialmethod object contains redundant commas and spaces. Compare it with the repr of partial:

>>> import functools
>>> def test(*args, **kwargs): pass
... 
>>> functools.partial(test)
functools.partial(<function test at 0x7fcbe91819d0>)
>>> functools.partial(test, a=1)
functools.partial(<function test at 0x7fcbe91819d0>, a=1)
>>> functools.partialmethod(test)
functools.partialmethod(<function test at 0x7fcbe91819d0>, , )
>>> functools.partialmethod(test, a=1)
functools.partialmethod(<function test at 0x7fcbe91819d0>, , a=1)

cc @dg-pb @rhettinger

Linked PRs

@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error 3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes labels Jun 26, 2024
@picnixz
Copy link
Member

picnixz commented Jun 26, 2024

I'll take this one if possible!

serhiy-storchaka pushed a commit that referenced this issue Jun 26, 2024
It no longer contains redundant commas and spaces.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 26, 2024
It no longer contains redundant commas and spaces.
(cherry picked from commit d2646e3)

Co-authored-by: Bénédikt Tran <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jun 26, 2024
It no longer contains redundant commas and spaces.
(cherry picked from commit d2646e3)

Co-authored-by: Bénédikt Tran <[email protected]>
serhiy-storchaka pushed a commit that referenced this issue Jun 26, 2024
It no longer contains redundant commas and spaces.
(cherry picked from commit d2646e3)

Co-authored-by: Bénédikt Tran <[email protected]>
kumaraditya303 pushed a commit that referenced this issue Jun 26, 2024
gh-121025: Improve partialmethod.__repr__ (GH-121033)

It no longer contains redundant commas and spaces.
(cherry picked from commit d2646e3)

Co-authored-by: Bénédikt Tran <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this issue Jun 30, 2024
It no longer contains redundant commas and spaces.
noahbkim pushed a commit to hudson-trading/cpython that referenced this issue Jul 11, 2024
It no longer contains redundant commas and spaces.
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
It no longer contains redundant commas and spaces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 only security fixes 3.13 bugs and security fixes 3.14 bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants
@serhiy-storchaka @picnixz and others