Skip to main content

Backport of Python 2.7's collections module

Project description

https://badge.fury.io/py/backport_collections.png https://travis-ci.org/sk-/backport_collections.png?branch=master https://coveralls.io/repos/sk-/backport_collections/badge.png?branch=master

backport_collections is a backport of Python 2.7’s collections module for Python 2.6.

What is backported?

Counter, deque, OrderedDict and namedtuple are backported. The rest of the members of the collections module are still exposed. Note though that some ABC classes are slighlty different (see known issues below).

Usage

To use it just import the desired classes from the module backport_collections. Example:

from backport_collections import Counter
from backport_collections import deque
from backport_collections import OrderedDict
from backport_collections import namedtuple

Known Issues

  • In Python 2.6 Issue 9137 is not fixed as it complains if it gets a keyword argument named self. The error is TypeError: update() got multiple values for keyword argument 'self'. Additionally the keyword argument cannot be called other either as it will think it is the full dict. No error is raised in this case.

  • In Python 2.6 Issue 8743 is not fully fixed: Set interoperability with real sets

License

The Python Software Foundation License.

Changes

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

backport_collections-0.1.tar.gz (37.7 kB view details)

Uploaded Source

File details

Details for the file backport_collections-0.1.tar.gz.

File metadata

File hashes

Hashes for backport_collections-0.1.tar.gz
Algorithm Hash digest
SHA256 939ac17313c6cda524b15fea9706af6ececd07b763a48b371b5b6d345b05eab7
MD5 b4cb1ede168fc9cb7d4f59399a15fbca
BLAKE2b-256 d0ddd833f666d54a3ec27a8ffd85e2c05838585550de3b38addd8a11d8528734

See more details on using hashes here.

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