bits-819 released with these changes:

  • Add a "python" command to invoke the Python interactive interpreter

    This will launch the normal Python REPL, making it possible to run multi-line commands, nested compound commands, and run expressions having both single and double quotes without worrying about GRUB quoting. And there was much rejoicing.

  • readline: Support the completer interface, and make tab complete

    Tab completes by default, without needing to explicitly bind it with something like readline.parse_and_bind("tab: complete") (which is a no-op for compatibility).

    The completion interface currently cycles through possible completions, rather than listing possible completions. The list behavior may become available as a configurable option in the future.

  • Add the Python rlcompleter module, and use it by default.

    Note that rlcompleter will evaluate Python expressions as it completes them. However, this matches the recent change to the defaults of upstream Python 3, which enables completion by default as well.

  • readline: Signify EOF by returning an empty string, not by raising EOFError

    Python generates an EOF internally when the readline function returns an empty string. This fixes the ability to exit.

  • python: Define the builtin help() function.

  • Support the Python math module

    This incorporates additional math functions from fdlibm, as well as some implementations supplied by Python.

  • Add a new bits.pyfs_file class representing a StringIO-backed temporary file in the (python) filesystem.

  • Port redirect to use the new pyfs_file abstraction

  • testsuite: Simplify test config file generation, and only generate it once

    Previously, testsuite regenerated the config files after each call to add_test.