boundinstance
boundinstance provides InstanceDescriptor, a descriptor that binds weakly to the instance it was accessed from, so a subclass can carry a reference back to its enclosing object without creating a reference cycle.
Install
pip install boundinstance
Usage
from boundinstance import InstanceDescriptor
class Plot(InstanceDescriptor["Potential"]):
def label(self) -> str:
return f"plot of {self.enclosing.name}"
class Potential:
plot = Plot()
def __init__(self, name: str) -> None:
self.name = name
hernquist = Potential("hernquist")
assert hernquist.plot.label() == "plot of hernquist"
The reference back to the enclosing object is weak, so it doesn't outlive a temporary: bind the enclosing object to a name before reading enclosing from it, or you'll hit a ReferenceError (Potential("hernquist").plot.label() fails; hernquist.plot.label() works because hernquist keeps the object alive).
Compiled wheels
boundinstance ships mypyc-compiled wheels for supported platforms, plus a pure-Python sdist that needs no compiler. boundinstance.COMPILED reports whether the installed build is mypyc-compiled.
Release files for boundinstance 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| boundinstance-0.1.0.tar.gz | 114.9 kB | Details |
Built distributions (wheels)
Total release size: 640.5 kB
Release files / boundinstance-0.1.0.tar.gz
| Download URL | boundinstance-0.1.0.tar.gz |
|---|---|
| Size | 114.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f030f259854de019ff79a434936e94c4eb7a879cb441fcdd9d18ff1b251a87a
|
|
BLAKE2b-256 checksum How to use checksums |
8d7ac3fe99e17c4165f331a77d27a9f827cee98504a423d0ea1c3e3e8e1c6900
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp314-cp314-win_amd64.whl
| Download URL | boundinstance-0.1.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 35.2 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7791967013c098d65df18bff52ece3bfbf139d597de083eab571bcfdb2d27959
|
|
BLAKE2b-256 checksum How to use checksums |
b7937dce68e0b6cf8a5dee70b2e3ba5bc8de766ca08e2153d7ca6897a172e35b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | boundinstance-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 76.9 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
38e8bd74cd8fd2043b78746fb4c4090349f892dde086a8eb41986a4c56be2cbf
|
|
BLAKE2b-256 checksum How to use checksums |
acf00467d96a5a4aa1f89fa7bf5631beb72e143365cf225c39e4a3bc89ba9bb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp314-cp314-macosx_10_15_x86_64.whl
| Download URL | boundinstance-0.1.0-cp314-cp314-macosx_10_15_x86_64.whl |
|---|---|
| Size | 61.7 kB |
| Tags | CPython 3.14 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
83da1aebd558d9d74784e8e2800b32465b5ee9570a94deae39c8dfd29a61fa8a
|
|
BLAKE2b-256 checksum How to use checksums |
e33297f486d4cda0587961d7df735559ccaf8cbced960ae9c571016078b6a8fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp313-cp313-win_amd64.whl
| Download URL | boundinstance-0.1.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 35.5 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
997e3ebbf3e25ea8e8524dfd4e50cdbdb07c78acee1fd925ba08ff6a9fb55dee
|
|
BLAKE2b-256 checksum How to use checksums |
61aaff7fbf7ec1fae0bf40df231e8702e1f9f0d995c9f5b7f45e4aedd30d55f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | boundinstance-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 77.6 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ce4da3f22ed2a56fdbf36a2b3211a92b8bf9b1f259e3b1e376baddf5db396295
|
|
BLAKE2b-256 checksum How to use checksums |
d5ac83ba93c05b128cfbeead9c90d2e297c9d173b3634bcbbb00b9f3f02aaee2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | boundinstance-0.1.0-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 62.0 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
5bc03cb90621496d298531d337b7272bbca660573ff2b1f3a67999d233025b82
|
|
BLAKE2b-256 checksum How to use checksums |
4718a8a85396135c8329e9876a2bd85b96d8da80896f9007695262f88e1e9c91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp312-cp312-win_amd64.whl
| Download URL | boundinstance-0.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 35.5 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0b7f02bf9b6f00276b2d45dff5467e256d32a8c8efbfb167db124aec43528a8b
|
|
BLAKE2b-256 checksum How to use checksums |
fb08c5f21a302619a8e8197662eebec692e2c422ba7842ef96a06c30362528b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | boundinstance-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 78.3 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1f9b115fe945a3ea878c98a4b796a6157282af100da90c031f69296cfb497b53
|
|
BLAKE2b-256 checksum How to use checksums |
15a949b3bafb248886e49e1a2f892f948877270c722e41c2f43895b5d36485c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency logRelease files / boundinstance-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | boundinstance-0.1.0-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 62.9 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
73e36c2b868893461cb91a6e22994071cc9b93012f0f51abdd4c438a3fc8aeee
|
|
BLAKE2b-256 checksum How to use checksums |
f3f78620a6fd695608ef5bb642305424d26e302eddc1cba81bf24ec8a7d93e66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.
Transparency log