Repository navigation
Release Notes
uv add --dev "basedpython>=0.0.3"stubs
- a module with a stub is checked against it:
what the stub declares for a parameter, a return type, a module variable or a class attribute
the module leaves unannotated is its declared type in the module's own body, and
missing-runtime-member,incompatible-stub-signature,incompatible-stub-attribute,
incompatible-stub-basesandmissing-stub-memberreport where the two disagree - a stub's types are read in terms of the runtime module it describes, so a class the stub defines
is the module's class of the same name - a package with a
by.typedmarker is typed by its.byi, as its.byis already the source,
rather than by the.pyiderived from it - an editor can show a stub and its module side by side, declaration by declaration, with
by/documentCounterparts - the on-disk copy of the vendored stubs is named after their contents, so a new
byno longer
opens an older one's copy for go-to-definition
by run and by repl
by runtakes the path of
a file as well as a module name:by run app/cli.byrunsapp.cliinside its package, and
by run manage.py checkruns a.pyfile as python runs a script.by repl --moduletakes a
path with the same meaning- what the program writes into the staged tree is written back to the project: a new file, or a
changed copy of a file still holding what was staged. a file the program deleted, renamed away
or replaced is kept and reported, and nothing in__pycache__is written back --notes PATHwrites whatby runsays after the program ends toPATHas json lines, so the
program's own last line ends the output- an uncaught exception prints every exception chained to it, as python does, and its traceback
leaves out every frame ofby's own runner - the program gets the
__main__namespace python gives a script - a module
importlib.reloadcompiles after its.bywas saved over is compiled where it is
django
- a
manage.pylens
in a project with a.bysource runs throughby run, so the command sees the.bymodels and
what it writes is written back - a lens runs the
manage.pyit was offered for, so two django workspaces each run their own,
and is refused in a workspace the editor does not trust
narrowing
- a predicate
or assertion
recovered from a function's body narrows in.pyfiles too, and its hint shows the place it narrows - recovery no longer narrows through a
breakout of afinally, a non-defoverride, a
decorator, or aTypeIsabout another place
editor
- every inlay hint whose label is source carries the edit that writes it, and a tooltip where it
has more to say.by/inlayHintCataloglists every kind of hint with a live example - no completions are offered inside a number literal
other changes
- a directory below a package root holding a basedpython module is a
regular package without an
__init__.by - a type test at the end of a comparison chain,
x < 1 is int, is rejected rather than lowered to
x < False, and the linter no longer reports python's identity-comparison rules on a type test - a checked
.pyoperator dunder declares theNotImplementedit returns, as a.byone does - an override in a vendored stub takes no default from the method it overrides
Install basedpython 0.0.3
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/KotlinIsland/basedpython/releases/download/0.0.3/basedpython-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/KotlinIsland/basedpython/releases/download/0.0.3/basedpython-installer.ps1 | iex"Download basedpython 0.0.3
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/basedpythonYou 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>