Skip to main content
https://img.shields.io/pypi/v/jaraco.compat.svg https://img.shields.io/pypi/pyversions/jaraco.compat.svg tests Ruff https://readthedocs.org/projects/jaracocompat/badge/?version=latest https://img.shields.io/badge/skeleton-2026-informational

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

♫ It’s going to be the future soon. It won’t always be this way, when the things that make me weak and strange get engineered away. ♫

Usage

Import functions from the appropriate compat.pyXX module in your python code. When a package is eventually ready to upgrade beyond pyXX, 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 compat.py25 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 py25 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)

Download files

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

Source Distribution

jaraco_compat-4.4.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jaraco_compat-4.4.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file jaraco_compat-4.4.0.tar.gz.

File metadata

  • Download URL: jaraco_compat-4.4.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for jaraco_compat-4.4.0.tar.gz
Algorithm Hash digest
SHA256 c0e3d11a4267a3ac98c58f3283eebd21472ec3e98facccc93263ceed13c9617c
MD5 9e81e6e9cfd3d7022ba7571cea23da3d
BLAKE2b-256 041a35b3679a31df41911297df963ab4c0db4f974ca723992474ac899009d323

See more details on using hashes here.

File details

Details for the file jaraco_compat-4.4.0-py3-none-any.whl.

File metadata

  • Download URL: jaraco_compat-4.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for jaraco_compat-4.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ed1c7e7affe768ea3aa839bfa2444cf18a32a949a247a3c2b624497efccc4d9
MD5 a90d85f104b8a96662e594eb4097faa2
BLAKE2b-256 8b37c350a629a8a35e11049484f957569a7983ad31e9eee6968a054e65d1bc4f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

4.4.0 This release

2 files

4.3.1

2 files

4.3.0

2 files

4.2.2

2 files

4.2.1

2 files

4.2.0

2 files

4.1.0

2 files

4.0.0

2 files

3.1

2 files

3.0

2 files

2.2

2 files

2.1

2 files

2.0

2 files

1.4.1

2 files

1.4

1 file

1.3

1 file

1.2

1 file

1.1

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

1.0

1 file

0.9.1

1 file

0.9

1 file

0.8

1 file

0.7.1

1 file

0.7

1 file

0.6

1 file

0.5

1 file

0.4

1 file

0.3

1 file

0.2

1 file

0.1

1 file

0.1dev

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page