Skip to content

v0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 May 03:10
· 31 commits to main since this release

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 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