-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Dis
module doesn't know how to disassemble async generator or coroutine objects
#75366
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
Comments
bpo-21947 informed the Credit to Luciano Ramalho: I tripped over this at his (great) concurrency workshop at PyBay 2017 and he identified exactly what was happening and suggested a patch. |
Adding Serhiy and Nick who worked on these parts of CPython. |
Is this a bug fix or a new feature? Adding support of generators in bpo-21947 was a new feature and was not backported to older versions. |
Hm--either/both? I encountered it as a bug ("dis works on my generator object and my async generator function, why does it break on my async generator object?") but strictly speaking it's a new feature (just as bpo-21947 was). To my mind, adding this level of indirection (finding the code object) for generators was a bit of a design decision but once it's in for generators it should be in for async generators and coroutines by analogy. |
While I agree the line is blurry, extending automatic disassembly to cover new types is currently still considered a new feature in the dis module rather than a bug in the addition of those new types to the language. Whether or not that's the right policy, or if we should consider tweaking it so that oversights in |
Makes sense. I'll update the PR in a bit, and if anyone is hitting this repeatedly and thinks it should be added to 3.6 they can advocate for a policy change in the maintaining-consistency-with-previous-new-features corner case. Thanks, all! |
Thanks for the patch! bpo-31230 is a follow-up issue looking at whether or not we should define a general "__code__" attribute as a general purpose introspection protocol for disassembly support (amongst other generalisations of state introspection support for async operations). |
dis
to disassemble async generator and coroutine objects #3077Note: 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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: