Skip to main content

pyrefcount provides a simple API for reference counting, providing protected access to reference counted values, and for allowing acquire/release actions to be carried out when a reference count becomes active, or the last user drops off, respectively. pyrefcount is inspired by the Linux Kernel’s refcount_t API.

Usage

Usage of pyrefcount is straightforward:

>>> from refcount import Refcounter
>>> ref = Refcounter()
>>> ref.inc()
>>> ref.usecount
2
>>> ref.dec()
>>> if ref.dec_and_test():
...     print('refcount is now 0, do something here')

For more complex usage examples and a complete API reference, refer to the package documentation.

Features and Bugs

Please file feature requests and bug reports in the issue tracker.

License

pyrefcount is licensed under the MIT license.

Metadata

Release files for pyrefcount 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrefcount 0.1.0
File Size Uploaded
pyrefcount-0.1.0.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyrefcount 0.1.0
File Interpreter ABI Platform
pyrefcount-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / pyrefcount-0.1.0.tar.gz

Download URL pyrefcount-0.1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d5f844946be5f2dee138711a131928563171739dd61ef271acab28f57b7ff7c9
BLAKE2b-256 checksum
How to use checksums
7546671708f55c69a1f75c04b040008b8da16c17cf1d45cf05b999fd56a85c7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

Release files / pyrefcount-0.1.0-py3-none-any.whl

Download URL pyrefcount-0.1.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
979d19deb4bb9b8cbc74d682328ddf9d976853983184b263de027db7efc23f34
BLAKE2b-256 checksum
How to use checksums
ba21d969d14ff7b6a58c45dbf0baca28f3951ffa4178b4cb79f36d75094430c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page