Skip to content

Releases: malbarbo/spython

v0.3.0

01 May 03:10

Choose a tag to compare

spython 0.3.0

spython is a teaching-oriented Python interpreter that requires complete type annotations and progressively unlocks language features through six teaching levels.

Try it online: https://malbarbo.pro.br/spython

New PEP 8 lints (all levels)

14 naming and style checks adapted from ruff:

  • Naming — function/method names (snake_case), class names (CapWords), argument names, local variables, enum members.
  • Comparisonsis/is not for None, redundant comparison to True/False, not in, is not.
  • Style — first instance-method argument must be self; collapse if cond: return True else: return False; reject f-strings without placeholders; flag unused locals and unnecessary pass.

Stricter type checking

  • division-by-zero and possibly-unresolved-reference are now errors.
  • More accurate diagnostic positions for assignment targets, subscripts, and other AST nodes.
  • from spython import * resolves on every platform.

Doctests

  • Parse errors and malformed >>> prompts inside docstrings are surfaced at static-check time instead of being silently skipped or crashing the runner.

REPL

  • Tab completion for : commands (:help, :time, :type, :quit, …).

Image library

The spython.image API has been redesigned for consistency:

  • Real enums for alignment, style, and font parameters.
  • overlay, underlay, above, and beside are now variadic with keyword-only x_place/y_place/x_offset/y_offset — the *_align/*_offset variants are gone.

Formatter

  • Code inside docstrings is formatted; string literals consistently use single quotes.

Supported platforms

  • Linux x86_64 / aarch64 (musl)
  • macOS x86_64 / aarch64
  • Windows x86_64
  • WASM (wasm32-wasip1)

Powered by RustPython 0.5.0 and ty/ruff 0.15.6.

Full changelog: v0.2.0...v0.3.0

v0.2.0

28 Apr 18:57

Choose a tag to compare

spython 0.2.0

spython is a teaching-oriented Python interpreter that requires complete type annotations and progressively unlocks language features through six teaching levels.

Try it online: https://malbarbo.pro.br/spython

New beginner-level lints (levels 0–3)

To catch common student mistakes earlier, levels 0 through 3 now reject:

  • Non-boolean conditionsif/elif/while/ternary/assert and operands of and/or/not must have type bool (checked via inferred types, not just AST).
  • bool in arithmeticbool is no longer accepted as an operand of +, -, *, /, //, %, **, augmented assignments, or unary +/-.
  • Chained comparisons — comparisons with more than one operator (a < b < c, 1 <= x <= 10, a == b != c, …) are rejected. Use and / or to combine two single comparisons instead.
  • Bare expressions — expression statements that aren't a call, docstring, or ... are rejected (suppressed in the REPL).
  • Default arguments — function parameters can no longer have default values.

All five lints are lifted at level 4.

Doctests

  • Doctests are now type-checked (with the same level rules as the surrounding code).
  • Malformed >>> prompts are reported instead of silently ignored.
  • Imported callables are skipped, so doctests in third-party code don't run.

REPL

  • New :time command to time the execution of an expression or statement.
  • The interpreter is now properly finalized when the REPL exits, releasing resources deterministically.

WASM

  • Fixed an issue where Ctrl-C / interrupt did not stop infinite loops in the eval loop (web playground).
  • Added a panic handler shared with the CLI for clearer error reporting.

Fixes

  • Doctest paths are virtualized so the in-memory filesystem accepts Windows-style working directories.
  • rustyline pinned to version 18 to match the fork.

Internals

  • CLI integration tests are now dual-run against the WASM backend in CI.
  • WASM regression test for interrupt stopping infinite loops.

Supported platforms

  • Linux x86_64 / aarch64 (musl)
  • macOS x86_64 / aarch64
  • Windows x86_64
  • WASM (wasm32-wasip1)

Powered by RustPython 0.5.0 and ty/ruff 0.15.6.

Full changelog: v0.1.0...v0.2.0

v0.1.0

01 Apr 16:28

Choose a tag to compare

spython 0.1.0

spython is a teaching-oriented Python interpreter that requires complete type annotations and progressively unlocks language features through six teaching levels.

Try it online: https://malbarbo.pro.br/spython

Features

  • Type-checked Python execution: annotation and type checking run before every script
  • 6 teaching levels (0-5) that progressively unlock Python constructs
  • Interactive REPL with syntax highlighting, auto-indent, tab completion, and type inference (:type)
  • Custom checker for annotations and construct restrictions per level
  • Built-in image library (spython.image) for SVG-based graphics programming
  • format command powered by ruff
  • check command for running doctests
  • WASM build for web usage
  • Powered by RustPython 0.5.0 and ty/ruff 0.15.6

Supported platforms

  • Linux x86_64 / aarch64 (musl)
  • macOS x86_64 / aarch64
  • Windows x86_64
  • WASM (wasm32-wasip1)