-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Question: how stable is it to round-trip code? #66
Comments
This is a perfectly legitimate use case of bytecode and any issue your encounter doing this would be a bug. @thautwarm if I remember correctly you use bytecode to modify constants and probably do a lot of round tripping as a consequence, can you comment on this too. |
@MatthieuDartiailh Yes, I did a lot of this sort of stuffs.. I don't see any corner case that would break, if any it must be a bug and should be solved. @fabioz For your use case, there might be something to be take care.
|
Thank you for the feedback. @thautwarm I'm actually using that only with Python 3.5 onwards and I'm converting the list to a double linked list (so that multiple insertions are efficient and to have a nicer API as iterating/changing items at the same time is a bit more straightforward), so, 1 and 2 are already ok, and thanks for the tip on the |
I'm experimenting on using bytecode to add programmatic breakpoints in pydevd (https://github.com/fabioz/PyDev.Debugger/).
The use case is getting the existing bytecode, adding some code to activate the pydevd breakpoint and then save it back (I'm trying to migrate from the existing code which does that but fails on some corner cases).
On my experiments it seems to be working well, but I was wondering if you know of any corner case where doing so would not be safe or if something else would need to be taken into account for such a round-trip to work.
p.s.: Sorry for using the tracker to ask a question, I wasn't sure what was the appropriate channel here.
The text was updated successfully, but these errors were encountered: