Skip to main content

No project description provided

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrefcount-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrefcount-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pyrefcount-0.1.0.tar.gz.

File metadata

  • Download URL: pyrefcount-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pyrefcount-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d5f844946be5f2dee138711a131928563171739dd61ef271acab28f57b7ff7c9
MD5 5e18306730b31b986ac87a34a5bee1b5
BLAKE2b-256 7546671708f55c69a1f75c04b040008b8da16c17cf1d45cf05b999fd56a85c7c

See more details on using hashes here.

File details

Details for the file pyrefcount-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyrefcount-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pyrefcount-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 979d19deb4bb9b8cbc74d682328ddf9d976853983184b263de027db7efc23f34
MD5 fd725e2e9ad07e8587b518a99b32d4a7
BLAKE2b-256 ba21d969d14ff7b6a58c45dbf0baca28f3951ffa4178b4cb79f36d75094430c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page