The greenlet package is a spin-off of Stackless, a version of CPython that supports micro-threads called "tasklets". Tasklets run pseudo-concurrently (typically in a single or a few OS-level threads) and are synchronized with data exchanges on "channels".
A "greenlet", on the other hand, is a still more primitive notion of micro-thread with no implicit scheduling; coroutines, in other words. This is useful when you want to control exactly when your code runs. You can build custom scheduled micro-threads on top of greenlet; however, it seems that greenlets are useful on their own as a way to make advanced control flow structures. For example, we can recreate generators; the difference with Python's own generators is that our generators can call nested functions and the nested functions can yield values too. Additionally, you don't need a "yield" keyword. See the example in tests/test_generator.py.
Greenlets are provided as a C extension module for the regular unmodified interpreter.
Greenlets are lightweight coroutines for in-process concurrent programming.
Install
pixiaddgreenlet
micromambainstall-c https://repo.prefix.dev/conda-forgegreenlet
Version
Platforms
Last published
Documentation
filename | version | build | Created | size | Architecture | Downloads | |
---|---|---|---|---|---|---|---|
greenlet-3.2.4-py311h1ddb823_0.conda | 3.2.4 | py311h1ddb823_0 (0) | 16 days ago | 238.33 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py313hb4b7877_0.conda | 3.2.4 | py313hb4b7877_0 (0) | 16 days ago | 229.2 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py39hdb6649d_0.conda | 3.2.4 | py39hdb6649d_0 (0) | 16 days ago | 195.37 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py311h3e6a449_0.conda | 3.2.4 | py311h3e6a449_0 (0) | 16 days ago | 221.88 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py310h16b79ff_0.conda | 3.2.4 | py310h16b79ff_0 (0) | 16 days ago | 213.89 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py311h1606a6e_0.conda | 3.2.4 | py311h1606a6e_0 (0) | 16 days ago | 239.49 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py310h57cea71_0.conda | 3.2.4 | py310h57cea71_0 (0) | 16 days ago | 212.09 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py312h462f358_0.conda | 3.2.4 | py312h462f358_0 (0) | 16 days ago | 227.36 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py312hbb81ca0_0.conda | 3.2.4 | py312hbb81ca0_0 (0) | 16 days ago | 218.56 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py310h73ae2b4_0.conda | 3.2.4 | py310h73ae2b4_0 (0) | 16 days ago | 196.28 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py39h818bca1_0.conda | 3.2.4 | py39h818bca1_0 (0) | 16 days ago | 211.76 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py310hea6c23e_0.conda | 3.2.4 | py310hea6c23e_0 (0) | 16 days ago | 213.36 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py310h1af2607_0.conda | 3.2.4 | py310h1af2607_0 (0) | 16 days ago | 205.77 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py312h1ab2c47_0.conda | 3.2.4 | py312h1ab2c47_0 (0) | 16 days ago | 234.5 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py312h14a853b_0.conda | 3.2.4 | py312h14a853b_0 (0) | 16 days ago | 236.18 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py311hf719da1_0.conda | 3.2.4 | py311hf719da1_0 (0) | 16 days ago | 230.96 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py312h1289d80_0.conda | 3.2.4 | py312h1289d80_0 (0) | 16 days ago | 232.56 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py313hfe59770_0.conda | 3.2.4 | py313hfe59770_0 (0) | 16 days ago | 219.28 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py313h7033f15_0.conda | 3.2.4 | py313h7033f15_0 (0) | 16 days ago | 234.06 KB | N/A | ||
Dependencies: | |||||||
greenlet-3.2.4-py311h7b20566_0.conda | 3.2.4 | py311h7b20566_0 (0) | 16 days ago | 230.29 KB | N/A | ||
Dependencies: |