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
The debugger calls f_locals on all frames #13972
Comments
@mlucool, our solution was to disable the IPython |
Thanks @ccordoba12. I deleted my comment in part because it turns out debuggerskip was not adding that much for that specific test (that is, it matters, but not as much as something I am yet to figure out) |
I'm not 100% sure this is correct as technically the value of __debugger_skip__ could change in the current frame while we are stepping into it, but that is likely super rare, and the slowdown that this create is problematic. There is still a small overhead for me, but this should make the experience much better. See spyder-ide/spyder-kernels#458, #13972, spyder-ide/spyder#20571, #14382
To reproduce, debug the following code line by line, pressing next on each line:
This results in:
AttributeError: 'NoneType' object has no attribute 'layout'
The problem is that the IPython debugger calls
frame.f_locals
on every step on every call. Callingframe.f_locals
will reset the locals of the frame, and plotly does this:https://github.com/plotly/plotly.py/blob/a4b9887bc7d5f5151b803221fa650291840d150e/packages/python/plotly/plotly/express/_chart_types.py#L424
The second issue is that looping on all frames on each python instruction is slow:
spyder-ide/spyder#20571
The text was updated successfully, but these errors were encountered: