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
    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


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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

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