Repository navigation
spython 0.3.0
spython is a version of Python for students. It checks types before running anything, restricts the language by level, and comes with a REPL and libraries for drawing images and writing interactive programs.
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