Repository navigation
Pystachy v0.6.1
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 aNamedTupleobject as atuple, and a tuple of types that holdsNoneraises CPython'sTypeError. A localtypethat holds the builtin, such as a parametertype=type, still makestype(None)meanNoneType; any other is rejected at compile time. (#1581) repr()of a set or frozenset that an element's__repr__prints again givesset(...), where it raisedRecursionError. (#1586)- A program that runs out of memory during a collection prints
MemoryError, runs itsatexitcallbacks and exits with status 1, where it could die of SIGSEGV. (#1585) - A
pyobjobject 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 raisesUnicodeEncodeError, where it returned the bytes. (#1587) Decimal's//,%anddivmod()take the time their operands' sizes need at any precision; atMAX_PRECthey did not finish. (#1615)bytearray(True)is one zero byte, where it was rejected, and boxing a set intoAnyis rejected with advice that compiles. (#1552, #1591)- With
PYSTACHY_DEBUG_LINES=1, a loop's step, awithstatement'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.