Skip to content
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

Dis module doesn't know how to disassemble generators #66146

Closed
httpsgithubcomhakril mannequin opened this issue Jul 9, 2014 · 7 comments
Closed

Dis module doesn't know how to disassemble generators #66146

httpsgithubcomhakril mannequin opened this issue Jul 9, 2014 · 7 comments
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@httpsgithubcomhakril
Copy link
Mannequin

httpsgithubcomhakril mannequin commented Jul 9, 2014

BPO 21947
Nosy @rhettinger, @ncoghlan, @pitrou, @vstinner, @https://github.com/hakril
Files
  • dis_generator.patch: patch for Lib/dis.py for generator disassembling
  • dis_generator2.patch: patch with unit test and doc update
  • dis_generator3.patch: Updated the docstrings of modified functions
  • 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 = <Date 2014-07-25.13:09:09.277>
    created_at = <Date 2014-07-09.14:28:29.287>
    labels = ['extension-modules', 'type-feature']
    title = "`Dis` module doesn't know how to disassemble generators"
    updated_at = <Date 2014-07-25.13:09:09.277>
    user = 'https://github.com/httpsgithubcomhakril'

    bugs.python.org fields:

    activity = <Date 2014-07-25.13:09:09.277>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-07-25.13:09:09.277>
    closer = 'ncoghlan'
    components = ['Extension Modules']
    creation = <Date 2014-07-09.14:28:29.287>
    creator = 'hakril'
    dependencies = []
    files = ['35914', '35918', '35954']
    hgrepos = []
    issue_num = 21947
    keywords = ['patch']
    message_count = 7.0
    messages = ['222619', '222637', '222642', '222650', '223030', '223943', '223944']
    nosy_count = 6.0
    nosy_names = ['rhettinger', 'ncoghlan', 'pitrou', 'vstinner', 'python-dev', 'hakril']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue21947'
    versions = ['Python 3.5']

    @httpsgithubcomhakril
    Copy link
    Mannequin Author

    httpsgithubcomhakril mannequin commented Jul 9, 2014

    The dis module doesn't know how to disassemble generator object because it has no idea about the gi_code attribute.
    I made a (very) little patch to change this behavior.

    If there is a valid reason to not let the dis module disassemble generator, I would be glad to know it.

    @httpsgithubcomhakril httpsgithubcomhakril mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Jul 9, 2014
    @pitrou
    Copy link
    Member

    pitrou commented Jul 9, 2014

    That sounds like a good idea. The patch lacks a unit test, though.

    @httpsgithubcomhakril
    Copy link
    Mannequin Author

    httpsgithubcomhakril mannequin commented Jul 9, 2014

    Here is a try for a better patch.
    Added a unit test and updated the doc.

    @rhettinger
    Copy link
    Contributor

    +1

    @httpsgithubcomhakril
    Copy link
    Mannequin Author

    httpsgithubcomhakril mannequin commented Jul 14, 2014

    Updated some docstrings in the new patch after the review comments.
    Thanks kushou for the code review.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 25, 2014

    New changeset 2ae5709692ef by Nick Coghlan in branch 'default':
    Issue bpo-21947: handle generator-iterator objects in dis
    http://hg.python.org/cpython/rev/2ae5709692ef

    @ncoghlan
    Copy link
    Contributor

    Thanks for the patch Clement!

    Could I also please request that you sign the Contributor License Agreement at https://www.python.org/psf/contrib/contrib-form/

    While we have some discretion to accept "small" patches without one, a signed CLA helps assure that we have the necessary rights to incorporate and redistribute contributions worldwide.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants