Skip to main content

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


Download files

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

Source Distribution

nxpy_past-1.0.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

nxpy_past-1.0.3-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nxpy_past-1.0.3.tar.gz.

File metadata

  • Download URL: nxpy_past-1.0.3.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for nxpy_past-1.0.3.tar.gz
Algorithm Hash digest
SHA256 536a09a471cc8e44a82c3a0f8e8ac19fa5ec2de27bcc93e9fba55169242f6a63
MD5 8cf80135aa90e48c686a067594cd336c
BLAKE2b-256 23587f54cafbb9dcc1437bbdbf79ba463fab6c8634fa0f33db36d70e24a53452

See more details on using hashes here.

File details

Details for the file nxpy_past-1.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: nxpy_past-1.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for nxpy_past-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b88f01bb4bb979d15c66371a1bb851aea9f54f9bf97b01a17f6c4909b070b0a6
MD5 271176547659f40a2e42194fbd4fad57
BLAKE2b-256 f155237a061296b091c36ca2215cc7f68c3743ebcb11a7e6ca83c034216023f4

See more details on using hashes here.

Supported by

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