Skip to content

0.0.1

Choose a tag to compare

@github-actions github-actions released this 16 Nov 03:38

Release Notes

the first stable release of basedpython: a python-like language with sum types, extensions,
optional chaining and a type system that knows what your code means, transpiled to plain python
any python tool can read. it ships as the basedpython package, with two executables: by, the
type checker, transpiler and project driver, and buff, the linter and formatter

uv add --dev "basedpython>=0.0.1"

getting started takes about five minutes. the
feature reference has a page for everything below

why try it

  • plain python out the other end: by build writes ordinary .py files, so pytest, mypy,
    ruff and the rest of your stack keep working
  • write for the newest python, ship for the oldest: polyfills
    lower new syntax to run on the interpreters your users have
  • a type checker that is useful on plain python too: built on ty, with
    sound types in place of gradual ones and
    framework support for pydantic, sqlalchemy, pytest and
    django
  • native speed when you want it: by compile builds
    the same source into CPython extension modules
  • tooling from day one: a language server, a formatter, a linter and an
    intellij plugin

the language

.by keeps almost all of python's meaning; differences from python
lists every place it does not

the type system

transpiling and running

native compilation

by compile builds modules into native CPython
extension modules for python 3.11 to 3.14, including the free-threaded builds. a function it cannot
compile keeps its interpreted definition, and --verbose says which and why

editors

  • the language server gives completions, inlay hints, hover,
    an outline and refactorings such as moving a
    definition, extracting a superclass and changing a signature
  • the intellij plugin makes .by a first-class
    language in PyCharm and IntelliJ IDEA, with by, buff and the debugger bundled
  • by check answers from a running language server's
    warm state when there is one
  • buff lints and formats .by with ruff's rules plus the
    BY rules, and aligns consecutive assignments

frameworks

pydantic, sqlalchemy,
pytest and django
are modelled directly, so synthesized constructors, mapped columns and injected fixtures check like
ordinary code. the language server also understands
django templates, and
basedpython-ui is a compose-style ui library the
type checker knows

packaging

installing without python

each release on github carries a basedpython-<target> archive of by and buff for 17 targets,
with shell and powershell installers

since 0.0.1b2

  • raise can be written as an expression
    anywhere a value can, as in table.get(key) ?? raise KeyError(key)
  • a match over a sealed class's subclasses is exhaustive, closed over the
    workspace
  • an unannotated parameter of an override takes its type from every method it
    overrides
  • a call to a function that asserts a variable of an enclosing scope narrows that variable
  • reified type parameters are tested by the same subtype relation the checker uses, at every depth,
    and a type parameter reads as a type form, so T() without an isinstance(T, type) is an error
  • an annotation written as a literal, x: 1, is the same type as Literal[1]
  • the editor reports what stops a module that checks clean from transpiling, and offers an
    "invert boolean" refactoring and renames of the overrides, parameters and modules tied to a
    renamed symbol
  • by run and by repl pass the signals that end a process on to the program
  • a PEP 723 script's own type-checking-preset applies when a project override names the script
  • api.lock is the same whatever order modules are found in
  • windows paths in tracebacks and sourcemaps read C:\... rather than \\?\C:\...
  • by --version reports basedpython's version
  • the standalone archives and installers are published on the github release page

Install basedpython 0.0.1

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/KotlinIsland/basedpython/releases/download/0.0.1/basedpython-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/KotlinIsland/basedpython/releases/download/0.0.1/basedpython-installer.ps1 | iex"

Download basedpython 0.0.1

File Platform Checksum
basedpython-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
basedpython-x86_64-apple-darwin.tar.gz Intel macOS checksum
basedpython-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
basedpython-i686-pc-windows-msvc.zip x86 Windows checksum
basedpython-x86_64-pc-windows-msvc.zip x64 Windows checksum
basedpython-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
basedpython-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
basedpython-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
basedpython-riscv64gc-unknown-linux-gnu.tar.gz RISCV Linux checksum
basedpython-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
basedpython-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
basedpython-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
basedpython-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
basedpython-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
basedpython-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
basedpython-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
basedpython-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

Verifying GitHub Artifact Attestations

The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:

gh attestation verify <file-path of downloaded artifact> --repo KotlinIsland/basedpython

You can also download the attestation from GitHub and verify against that directly:

gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>