Skip to content

0.0.2

Choose a tag to compare

@github-actions github-actions released this 18 Nov 13:21

Release Notes

uv add --dev "basedpython>=0.0.2"

operator dispatch

operator dispatch follows python's own rule:
an operation falls back past a dunder only for an operand outside its parameter's runtime domain

  • a .by operator dunder tests its operand before its body runs, and returns NotImplemented
    outside the parameter's domain
  • a .py operator dunder is checked against the operand python hands it: the body sees what's
    outside the domain, and a NotImplemented inside the domain falls back
  • NotImplemented is typed: a written NotImplementedType return falls back, and .by declares it
  • an __eq__ or __ne__ override may narrow its operand, or declare NotImplementedType
  • an operand that may share a subclass with a dunder's domain may reach it, so the operation may be
    either side's answer; an exact, final or disjoint-base operand stays outside
  • a subclass's reflected dunder answers as its ancestor's own dunder does, and a class's __gt__
    as its own __lt__ unless the class is final
  • a subclass's in-place dunder answers as its ancestor's binary dunder does, and an operator dunder
    override takes only what the overridden dunder takes. invalid-reflected-dunder is now
    invalid-operator-override

protocols

  • a protocol lowers onto basedpython's own protocol base rather than typing.Protocol;
    lowering.compatibility restores typing.Protocol.
    runtime_checkable is reported, and the two kinds of protocol don't mix
  • a built package's by.typed records whether it was lowered with lowering.compatibility, and a
    project reads that package's protocols as it was built

other changes

  • an abstract method is implemented by a class mixed in later in the mro, so class E(D, Impl) is
    implemented by Impl
  • by init creates the project's environment with uv sync, and the main.by template no longer
    calls main()
  • the docs carry basedpython's logo and palette, show the python by writes beside the landing
    page's example, and unfurl into a social card when shared

Install basedpython 0.0.2

Install prebuilt binaries via shell script

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

Install prebuilt binaries via powershell script

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

Download basedpython 0.0.2

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>