python / python/cpython

inspect.getsourcefile and inspect.getcomments do not work with decorated functions

Open
#78,486 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

BPO 34305
Nosy @1st1, @eric-wieser, @tirkarthi
PRs
  • python/cpython#8602
  • 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 2018-08-01.07:20:53.875>
    labels = ['library']
    title = 'inspect.getsourcefile and inspect.getcomments do not work with decorated functions'
    updated_at = <Date 2020-03-12.09:29:43.433>
    user = 'https://github.com/eric-wieser'
    

    bugs.python.org fields:

    activity = <Date 2020-03-12.09:29:43.433>
    actor = 'Eric Wieser'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2018-08-01.07:20:53.875>
    creator = 'Eric.Wieser'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34305
    keywords = ['patch']
    message_count = 4.0
    messages = ['322847', '324704', '363448', '364006']
    nosy_count = 5.0
    nosy_names = ['yselivanov', 'Eric.Wieser', 'rmccampbell7', 'xtreak', 'Eric Wieser']
    pr_nums = ['8602']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34305'
    versions = []
    

    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

    Start by examining inspect.getsourcefile and inspect.getcomments, focusing on how they handle decorated functions. Reproduce the reported behavior and compare it with undecorated functions; done means both functions work correctly for decorated functions, with the relevant behavior covered by tests if the existing inspect test suite is located.

    Written by the indexing model from the issue text.

    Assessment

    Tech stack
    python
    Domain
    devtools
    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.