Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Modules providing forward compatibility across some Python 2.x versions

Project Description

Forward compatibility for Python packages, allowing future constructs to be borrowed before they’re available in the standard library.

This package is generally deprecated in favor of more surgical backports in separate packages.

License

License is indicated in the project metadata (typically one or more of the Trove classifiers). For more details, see this explanation.

Usage

Import functions from the appropriate pyXXcompat module in your python code. When you’re eventually ready to upgrade beyond pyXX, you can easily locate (with a grep) and replace those functions with the canonical implementations.

Example

Say you want a namedtuple (introduced in Python 2.6) in a project which supports Python 2.5 and greater:

from py25compat import namedtuple
MyTuple = namedtuple('MyTuple', 'a b c')
mt = MyTuple(1,2,3)

With jaraco.compat installed, this code will run on Python 2.5 and greater. When the project is ready to move to Python 2.6, one can easily grep for py25compat and make the necessary replacements with minimal impact on the code. In this case:

from collections import namedtuple
MyTuple = namedtuple('MyTuple', 'a b c')
mt = MyTuple(1,2,3)
Release History

Release History

This version
History Node

2.0

History Node

1.4.1

History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0

History Node

0.9.1

History Node

0.9

History Node

0.8

History Node

0.7.1

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

History Node

0.1dev

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jaraco.compat-2.0-py2.py3-none-any.whl (9.0 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jan 25, 2017
jaraco.compat-2.0.tar.gz (8.7 kB) Copy SHA256 Checksum SHA256 Source Jan 25, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting