Skip to content

Pystachy v0.6.1

Choose a tag to compare

@github-actions github-actions released this 20 Nov 08:49
3751241

Pystachy v0.6.1 fixes bugs that v0.6.0 shipped with: wrong isinstance() answers for Any values, a collector crash and runaway memory, and strict encodes that passed invalid UTF-8. It adds no features. Pystachy remains an experimental compiler for a typed subset of Python.

Fixes

  • With dynamic Any, isinstance() accepts a NamedTuple object as a tuple, and a tuple of types that holds None raises CPython's TypeError. A local type that holds the builtin, such as a parameter type=type, still makes type(None) mean NoneType; any other is rejected at compile time. (#1581)
  • repr() of a set or frozenset that an element's __repr__ prints again gives set(...), where it raised RecursionError. (#1586)
  • A program that runs out of memory during a collection prints MemoryError, runs its atexit callbacks and exits with status 1, where it could die of SIGSEGV. (#1585)
  • A pyobj object whose __sizeof__ reports a size near 2**63 no longer stops collection for the rest of the run. (#1584)
  • A str read from a file with an overlong UTF-8 sequence counts each of its bytes as a character in encodes too, as len() does: a strict ASCII encode raises UnicodeEncodeError, where it returned the bytes. (#1587)
  • Decimal's //, % and divmod() take the time their operands' sizes need at any precision; at MAX_PREC they did not finish. (#1615)
  • bytearray(True) is one zero byte, where it was rejected, and boxing a set into Any is rejected with advice that compiles. (#1552, #1591)
  • With PYSTACHY_DEBUG_LINES=1, a loop's step, a with statement's file close and a function's shared raise block carry their own source lines. (#1562)

Known limits

Dynamic Any and promoting integers remain experimental opt-ins. The known issues of v0.6.0 remain, except isinstance() of Any values that hold NamedTuple objects: reads of a builtin's name where a module global of that name is unbound (#1512), star imports from a module that binds __all__ inside try or if (#1513), an except clause's as name that an import bound (#1514) and isinstance() tests against a second base class (#1602). The compatibility reference lists the documented deviations.

Platforms

Native archive Requirements
Linux x86-64 / AArch64 Ubuntu 24.04 or compatible glibc 2.39+ Linux; LLVM 18
macOS arm64 / x86-64 macOS 15+, Xcode Command Line Tools; LLVM 20

Archives and Docker run without Python; the hosted compiler needs Python 3.11+ and reports commit unknown when installed with pip. Full verification targets Linux x86-64 and ARM64 with CPython 3.13.16. Linux archives are not manylinux packages.

Release assets

Native compiler archives for Linux x86-64/AArch64 and macOS arm64/x86-64 are attached below, with their SHA-256 checksums in SHA256SUMS. They require LLVM 18 on Linux or LLVM 20 on macOS; see the installation instructions.

Docker image: dta67/pystachy:v0.6.1 for linux/amd64 and linux/arm64, with LLVM 18 included.

Source commit: 37512410e050da72b97b927f7d69830ed8377faa.