Skip to content

Improve the repr of partialmethod #121025

Closed
Closed

Description

@serhiy-storchaka

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

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    3.12only security fixes
    3.13only security fixes
    3.14bugs and security fixes
    on Jun 26, 2024
  2. picnixz commented on Jun 26, 2024

    @picnixz
    Member

    I'll take this one if possible!

  3. added a commit that references this issue on Jun 26, 2024
  4. added 2 commits that reference this issue on Jun 26, 2024
  5. added a commit that references this issue on Jun 26, 2024
  6. added a commit that references this issue on Jun 26, 2024
  7. added a commit that references this issue on Jun 30, 2024
  8. added a commit that references this issue on Jul 11, 2024
  9. added a commit that references this issue on Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13only security fixes3.14bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions