Releases: malbarbo/spython
v0.3.0
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. - Comparisons —
is/is notforNone, redundant comparison toTrue/False,not in,is not. - Style — first instance-method argument must be
self; collapseif cond: return True else: return False; reject f-strings without placeholders; flag unused locals and unnecessarypass.
Stricter type checking
division-by-zeroandpossibly-unresolved-referenceare 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, andbesideare now variadic with keyword-onlyx_place/y_place/x_offset/y_offset— the*_align/*_offsetvariants 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
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 conditions —
if/elif/while/ternary/assertand operands ofand/or/notmust have typebool(checked via inferred types, not just AST). boolin arithmetic —boolis 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. Useand/orto 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
:timecommand 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.
rustylinepinned 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
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 formatcommand powered by ruffcheckcommand 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)