Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dpdani/cereggii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cereggii

supports free-threading PyPI - Version PyPI - Python Version GitHub License

Thread synchronization utilities for Python.

Documentation is here.

from cereggii import AtomicDict, ThreadSet

counter = AtomicDict({"red": 42, "green": 3, "blue": 14})

@ThreadSet.repeat(10)  # create 10 threads
def workers():
    counter.reduce_count(["red"] * 60 + ["green"] * 7 + ["blue"] * 30)

workers.start_and_join()

assert counter["red"] == 642
assert counter["green"] == 73
assert counter["blue"] == 314

Installation

The recommended installation method is to download binary wheels from PyPI:

pip install cereggii
uv add cereggii

Installing from sources

To install from source, first pull the repository:

git clone https://github.com/dpdani/cereggii

Then, install the build requirements (do this in a virtualenv):

pip install -e ".[dev]"

Finally, run the tests:

pytest

License

Apache License 2.0. See the LICENSE file.

Links

Cereus greggii

The Peniocereus Greggii (also known as Cereus Greggii) is a flower native to Arizona, New Mexico, Texas, and some parts of northern Mexico.

This flower blooms just one summer night every year and in any given area, all these flowers bloom in synchrony.

Wikipedia

Image credits: Patrick Alexander, Peniocereus greggii var. greggii, south of Cooke's Range, Luna County, New Mexico, 10 May 2018, CC0. source