Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install jaraco.compat

How to install jaraco.compat

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install jaraco.compat
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.2
1.2Never BuiltWhy not?
1.0.2 Available View build log
1.0.1 Available View build log
1.0 Available View build log
0.9.1 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.6 Available View build log
0.5 Available View build log
0.4 Available View build log
0.2 Available View build log
0.1 Available View build log
Windows (64-bit)
1.0.2
1.2Never BuiltWhy not?
1.0.2 Available View build log
1.0.1 Available View build log
1.0 Available View build log
0.9.1 Available View build log
0.8 Available View build log
0.7.1 Failed View build log
0.6 Failed View build log
0.5 Available View build log
0.4 Available View build log
0.2 Available View build log
0.1 Available View build log
Mac OS X (10.5+)
1.2 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
1.0 Available View build log
0.9.1 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.6 Available View build log
0.5 Available View build log
0.4 Available View build log
0.2 Available View build log
0.1 Available View build log
Linux (32-bit)
1.2 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
1.0 Available View build log
0.9.1 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.6 Available View build log
0.5 Available View build log
0.4 Available View build log
0.2 Available View build log
0.1 Available View build log
Linux (64-bit)
1.2 Available View build log
1.0.2 Available View build log
1.0.1 Available View build log
1.0 Available View build log
0.9.1 Available View build log
0.8 Available View build log
0.7.1 Available View build log
0.6 Available View build log
0.5 Available View build log
0.4 Available View build log
0.2 Available View build log
0.1 Available View build log
1.2 Available View build log
 
License
MIT
Depended by
Lastest release
version 1.2 on May 28th, 2013

jaraco.compat provides forward compatibility for Python packages, allowing future constructs to be borrowed before they're available in the standard library.

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)

Changes

1.2
  • Added py24compat.functools with wraps degenerate wrapper.
1.1
  • Added py27compat.traceback with format_exc helper (consistently returns unicode results).
1.0
  • Adding py26compat.subprocess.check_output.
0.9
  • Added py31compat.collections.lru_cache which provides a backport of the Python 3.2 cache of the same name.
0.8
  • Added py25compat.subprocess with term_proc and kill_proc which take Popen objects and terminate and kill them respectively.
0.7
  • Added py31compat.functools, which provides wraps and update_wrapper that supply the Python 3.2 __wrapped__ attribute.
  • Added py26compat.collections, which provides OrderedDict on Python 2.6 and earlier (via the ordereddict package).
0.6
  • Added py26compat.total_seconds
  • Added py24compat.partition
0.5
  • Added py26compat with cmp_to_key.

Subscribe to package updates

Last updated May 28th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.