Python version based conditionals
Project description
You can install the library with pip:
pip install nxpy-past
Nxpy Past provides ways to express conditions on the current Python version to help handling version differences:
import nxpy.core.past
if nxpy.core.past.V_2_6.at_least():
import abc
else:
class abc(object):
class ABCMeta(type):
def __new__(mcs, name, bases, dict):
return type.__new__(mcs, name, bases, dict)
It is also possible to express assertions on the current version to better document why some code fails:
import nxpy.core.past nxpy.core.past.enforce_at_least(nxpy.core.past.V_2_6)
The library’s documentation is available on ReadTheDocs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nxpy_past-1.0.4.tar.gz.
File metadata
- Download URL: nxpy_past-1.0.4.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fc901e149405f351f943c7bcad23956fdcb6d7b36068fa83127c4e1d68b46d1
|
|
| MD5 |
b993727a05e8ab04b66a67e409256ea5
|
|
| BLAKE2b-256 |
9b861d3a536ccbe5e82d7311e3d1d91cca5621138ac44b232a94ef8c8597c70c
|
File details
Details for the file nxpy_past-1.0.4-py2.py3-none-any.whl.
File metadata
- Download URL: nxpy_past-1.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5c4df4a2bb986e087227f59819ac9add626cedd615377b670c47422a695d17d
|
|
| MD5 |
2cd6731ef31b60a4e0b7caf06ff8ae77
|
|
| BLAKE2b-256 |
e7665a6508d4dd7fa036126524d5bb446d4b23aa347b2eb9bb94eaeacf0d3f09
|