Repository navigation
Visualizer: a statement call of your own function ends as None - #59
Merged
Merged
Conversation
A call that is a whole statement (a line of the program, a REPL input, a doctest example) now shows its None as the last step when the callee is the learner's own function: a def or lambda of the project's files or a library loaded with it, a method of their class, a function from an earlier REPL input. Built-ins, methods of built-in types and functions of modules that come with Python or glpython (print, xs.append, random, gturtle) keep their call text. The console is unchanged: nothing for None, as CPython's REPL. Checks: scripts/check-runtime-none-calls.py (in test:runtime) and a browser case in check-console-browser.mjs for Kasten, Ersetzung and Baum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P49. Until now, a call that is a whole statement and returns
Nonekept its call text as its last step. That hid what a function without a matchingreturngives.Rule (
_eval_call,_glpython_is_own_functioninsrc/runtime/visualizer.py), the same for a line of the program, a REPL input and a doctest example:None. That means a_GlpythonFunction(adefor lambda the visualizer traces), or a function whose code comes from a project file (/<path>), from code the visualizer compiled itself (<glpython>, e.g. methods of a class), or from an earlier REPL input (<repl>). This also covers functions of the project's other files, which stay opaque in a REPL or doctest trace.print(...),xs.append(1),random.shuffle(xs),gturtle.forward(10)).Noneas before. The console is unchanged: nothing forNone, as in CPython's REPL.Example:
anwenden('*', 3, 4)without a case for'*':None, with «Erhalten: (Keine Ausgabe) · Erwartet: 12» below it.None.None, as for a call whose value is used.Checks:
scripts/check-runtime-none-calls.py(new, intest:runtime), which fails on the old code:print,append,random.shuffle,gturtle;print, a function from an earlier REPL input,print, a value;None.check-console-browser.mjs, for each of Kasten, Ersetzung and Baum, in Chrome with Pyodide:None, whileprint/appendkeep their text;Noneand the console shows nothing;Nonewith «Erhalten» below it.doctests.pyis untouched, andcheck-runtime-doctests.pypasses.Going live:
v0.1.33, then bump the IDE.🤖 Generated with Claude Code