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

Resuming yielded iterators doesn't immediately show local variables #234

Open
JMCanning78 opened this issue Jul 1, 2021 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@JMCanning78
Copy link
Owner

In the iterators used for adjacentVertices and adjacentUnvisitedVertices in Graph.py, when the iterator resumes after yielding a value while stepping through the animation, the iterator's local variables aren't redisplayed when the iterator resumes after the caller asks for the next value. Ideally, the call stack would be restored, the yield statement highlighted, the local variables restored simultaneously without waiting for the user to advance to the next statement after the yield. I'm not sure if that's possible with the stepping mechanism which decides where to pause based on when the highlighted lines on the call stack change. Somehow it would have to allow performng the resumeCallEnvironment() call after restoring all the call stack highlights. I have a recollection, however, that I found a way around that problem when doing the iterators on TowerOfHanoi.py.

@JMCanning78 JMCanning78 added the enhancement New feature or request label Aug 20, 2021
@JMCanning78
Copy link
Owner Author

JMCanning78 commented Apr 27, 2022

Separate issue that might be resolvable: the local variable named pathin the minimumSpanningTree method is not shown. The depthFirst method yields its internal stack as the value that is bound to path, but the stack is hidden when the iterator yields. The path is shown by highlighting some edges, but it would be nice to keep the stack visible (labeled as "path") to show how those edges were communicated to the caller. There ought to be a way to exempt some display items from being hidden when iterators yield values (and keep them visible or restore their visibility when the iterator resumes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant