python / python/cpython

functools.update_wrapper breaks the signature of functools.partial objects

Open
#90,917 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib type-bug
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

BPO 46761
Nosy @ncoghlan, @larryhastings, @1st1, @isidentical, @ofey404
PRs
  • python/cpython#31529
  • Files
  • update_wrapper.breaks.partial.signature.test.py
  • update_wrapper.breaks.partial.signature.check.wrapped.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2022-02-15.18:06:14.844>
    labels = ['type-bug', '3.8', '3.9', '3.10', '3.11', '3.7', 'library']
    title = 'functools.update_wrapper breaks the signature of functools.partial objects'
    updated_at = <Date 2022-03-26.12:36:12.144>
    user = 'https://github.com/larryhastings'
    

    bugs.python.org fields:

    activity = <Date 2022-03-26.12:36:12.144>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2022-02-15.18:06:14.844>
    creator = 'larry'
    dependencies = []
    files = ['50625', '50639']
    hgrepos = []
    issue_num = 46761
    keywords = ['patch']
    message_count = 21.0
    messages = ['413299', '413557', '413688', '413778', '413814', '413833', '413876', '413896', '414175', '414176', '414638', '414890', '414937', '415024', '415025', '416023', '416024', '416025', '416028', '416031', '416060']
    nosy_count = 7.0
    nosy_names = ['ping', 'ncoghlan', 'larry', 'grahamd', 'yselivanov', 'BTaskaya', 'ofey404']
    pr_nums = ['31529']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46761'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']
    

    Contributor guide

    Open the contributing guide

    First steps

    1. Read the whole issue, then the project's contributing guide.
    2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
    3. Fork the repository and make your change on a branch.
    4. Open a pull request that references the issue number.

    Research direction

    Review PR #31529 and the two linked test files, update_wrapper.breaks.partial.signature.test.py and update_wrapper.breaks.partial.signature.check.wrapped.py. Start by reproducing the functools.partial signature behavior described in the title, then use the tests to verify that update_wrapper no longer breaks it.

    Written by the indexing model from the issue text.

    Assessment

    Tech stack
    python
    Domain
    backend
    Issue type
    Bug
    Difficulty
    3/5
    Estimated time
    1-2 days
    Activity status
    Stale
    Clarity
    Mostly clear
    Newbie friendliness
    30/100

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.