Skip to main content

pyyield: For when you don't know what time.sleep() does.

Keeping it at simple as possible, pyyield is a simple Python module build from C++ and executes 1 line of code:

::std::this_thread::yield()

The only reason for creating this was due to the inconsistencies when using time.sleep(), which until recently was not very well documented to how it's supposed to work when using with 0 or a small float, where some implementations don't seem to do anything on 0 and other implementations round up very small floats.

That is not to say the C++ yield is always the same either, but for that, read more

Usage:

Example usage, yield from a loop

from pyyield import pyyield

def workerLoop():
    while performSomeWork():
        pyyield()

Build and install from source:

pip install -r requirements.txt
python -m build -o ./dist
pip install ./dist/pyyield*.whl

Tests

pip install pytest        
pytest --verbose --log-cli-level=DEBUG

The tests are mainly there to make an extremely simple check of performance differences. Please change the tests and play around with it yourself to understand how it performs on the system you want to run it on!

For example, as of writing this, in GitHub Actions, ubuntu-latest, pyyield does not perform any better than sleep(0) on all python versions tested, printing the info:

Failed to at speed test: pyyield is not faster than sleep(0)!

Metadata

Release files for pyyield 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 pyyield 0.1.0
File Size Uploaded Provenance Actions
pyyield-0.1.0.tar.gz 40.7 kB Without provenance Details for pyyield-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyyield 0.1.0
File Actions
pyyield-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pyyield-0.1.0-cp312-cp312-win_amd64.whl
pyyield-0.1.0-cp312-cp312-manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for pyyield-0.1.0-cp312-cp312-manylinux2014_x86_64.whl
pyyield-0.1.0-cp312-cp312-macosx_10_9_universal2.whl CPython 3.12 CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64) Details for pyyield-0.1.0-cp312-cp312-macosx_10_9_universal2.whl
pyyield-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pyyield-0.1.0-cp311-cp311-win_amd64.whl
pyyield-0.1.0-cp311-cp311-manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for pyyield-0.1.0-cp311-cp311-manylinux2014_x86_64.whl
pyyield-0.1.0-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details for pyyield-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
pyyield-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for pyyield-0.1.0-cp310-cp310-win_amd64.whl
pyyield-0.1.0-cp310-cp310-manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for pyyield-0.1.0-cp310-cp310-manylinux2014_x86_64.whl
pyyield-0.1.0-cp310-cp310-macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) Details for pyyield-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
pyyield-0.1.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for pyyield-0.1.0-cp39-cp39-win_amd64.whl
pyyield-0.1.0-cp39-cp39-manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for pyyield-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
pyyield-0.1.0-cp39-cp39-macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) Details for pyyield-0.1.0-cp39-cp39-macosx_10_9_universal2.whl

Total release size: 471.7 kB

Release files / pyyield-0.1.0.tar.gz

Download URL pyyield-0.1.0.tar.gz
Size 40.7 kB
Tags Source
SHA-256 checksum
How to use checksums
99e71f362ec4dd44e0ccef53ddaf20367dc3df111e275d9e5888f840e87ba6de
BLAKE2b-256 checksum
How to use checksums
caf1f3406184498a82b656804a0be732c6618be1ea257251621781b23d9bc356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp312-cp312-win_amd64.whl

Download URL pyyield-0.1.0-cp312-cp312-win_amd64.whl
Size 31.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6674fa10661afd57096a5c246b700b4d988f587a85bdda9d15dfbc2ecf4cbc91
BLAKE2b-256 checksum
How to use checksums
622a08b5de58fe61448f576ba519ae1ed5fff7f0c8077a5dd37599529923a993
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp312-cp312-manylinux2014_x86_64.whl

Download URL pyyield-0.1.0-cp312-cp312-manylinux2014_x86_64.whl
Size 44.9 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
26b459176970a392ede554b4da81e0567edb407fde3fda564920aede637f09f9
BLAKE2b-256 checksum
How to use checksums
2fe94e5644155f195318f654943045b1ac110b88f8037f187aa35ab192d58640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp312-cp312-macosx_10_9_universal2.whl

Download URL pyyield-0.1.0-cp312-cp312-macosx_10_9_universal2.whl
Size 31.1 kB
Tags CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
26a40a7afd32ecd914d4c1f56aaae0c7a83202ca83c94a41e084998d2113b81f
BLAKE2b-256 checksum
How to use checksums
d7f24029883702dc4c24190440222edd57e421e5ae4235f9c198d6e66137804f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp311-cp311-win_amd64.whl

Download URL pyyield-0.1.0-cp311-cp311-win_amd64.whl
Size 31.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
81255c87a2c48348288cca4b761dd96e5be494c2b802207ef91d7dc31cb7890c
BLAKE2b-256 checksum
How to use checksums
be38e6d85c5292633e68ed7017dc503b2e85b9a12c12cd15b1f65a11453ba31b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp311-cp311-manylinux2014_x86_64.whl

Download URL pyyield-0.1.0-cp311-cp311-manylinux2014_x86_64.whl
Size 44.9 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3af9b317feb1280d1dd2f4d08535c2ff848e93c3ebf815d18613545316fe0f6a
BLAKE2b-256 checksum
How to use checksums
5d580a9151538b52a37ca7a7d1c81aec01ee1a2d418c9feaf311cda485ba9400
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp311-cp311-macosx_10_9_universal2.whl

Download URL pyyield-0.1.0-cp311-cp311-macosx_10_9_universal2.whl
Size 31.1 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
d3f30ec0f3ab78351f8a342ab32ce27a5d72f064f76e19d4ff7b8356434eb547
BLAKE2b-256 checksum
How to use checksums
1abecea6d790e45c88a08b24a7b9eacf359766fe3a768b25f56431c5a9959c69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp310-cp310-win_amd64.whl

Download URL pyyield-0.1.0-cp310-cp310-win_amd64.whl
Size 31.8 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
d35aaa3d8a109f0ea8628d30f482e175cbd8dd46abcb04e5a8ca06ee230a1f0f
BLAKE2b-256 checksum
How to use checksums
5fa0e71c207170b3a0cdc4cda128e7355d3c2c02482a13288c7ea167a2a232a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp310-cp310-manylinux2014_x86_64.whl

Download URL pyyield-0.1.0-cp310-cp310-manylinux2014_x86_64.whl
Size 44.9 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fda57ba81df57968ce8048659e81a0d84d8e966a2c7f1280334f347fdfbb9b2b
BLAKE2b-256 checksum
How to use checksums
85ce91cde523e2c9d9124c8489f88adccab95f89b9eafc1b5475291437722609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp310-cp310-macosx_10_9_universal2.whl

Download URL pyyield-0.1.0-cp310-cp310-macosx_10_9_universal2.whl
Size 31.1 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
a65fc206c7a06186adcb9c74f8c5ecc63a7c18e67ae39e43f0bfb392684d63a0
BLAKE2b-256 checksum
How to use checksums
d16ff443c1d4eed5b4259fe96531102487aebeb948051b32d85d95bafa9db3f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp39-cp39-win_amd64.whl

Download URL pyyield-0.1.0-cp39-cp39-win_amd64.whl
Size 31.8 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
a60f3790c59e1dd7565172bf8281493bf3436e87193814b18b64810931ba7e83
BLAKE2b-256 checksum
How to use checksums
4e0656f4bad9fdc4aa24d336a458a79df1d868153545a939b6876a432b5dfc5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp39-cp39-manylinux2014_x86_64.whl

Download URL pyyield-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
Size 44.7 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a504c8e4857f8ac8850edbb03352310bc2bd1c8f96d58863d45281befee734b3
BLAKE2b-256 checksum
How to use checksums
1d3515f0ceb6961e4e9f56bd41eda9596ccae05619ef660d8db36ab8f867b05e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Release files / pyyield-0.1.0-cp39-cp39-macosx_10_9_universal2.whl

Download URL pyyield-0.1.0-cp39-cp39-macosx_10_9_universal2.whl
Size 31.1 kB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
e7dd75306f8868b5a51b9dda3c406d16a73236fb4c10b353906dd53335c08c03
BLAKE2b-256 checksum
How to use checksums
132a0d9784fad5e97030842c531b21e6d51d5b3b753dc5169a7dabc0552eae6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.10.12

Security for pyyield 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

13 release files No provenance

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