Forward compatibility for Python packages, allowing future constructs to be borrowed before they are available in the standard library.
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)
Metadata
Release files for jaraco.compat 4.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jaraco_compat-4.4.0.tar.gz | 11.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jaraco_compat-4.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.3 kB
Release files / jaraco_compat-4.4.0.tar.gz
| Download URL | jaraco_compat-4.4.0.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0e3d11a4267a3ac98c58f3283eebd21472ec3e98facccc93263ceed13c9617c
|
|
BLAKE2b-256 checksum How to use checksums |
041a35b3679a31df41911297df963ab4c0db4f974ca723992474ac899009d323
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / jaraco_compat-4.4.0-py3-none-any.whl
| Download URL | jaraco_compat-4.4.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ed1c7e7affe768ea3aa839bfa2444cf18a32a949a247a3c2b624497efccc4d9
|
|
BLAKE2b-256 checksum How to use checksums |
8b37c350a629a8a35e11049484f957569a7983ad31e9eee6968a054e65d1bc4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|