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

automatic typed collections in python using decorators

Project Description

This is a python library for typed containers – it makes it safer & easier to work with lists & dicts of items of the same type by providing:

  • type checks
  • container methods
  • automatic dictionary keys


import containers

class Item:
    def __init__(self, x):
        self.x = x

    def sum(container):
        return sum(item.x for item in container)

    def key(self):
        return self.x

list_ = Item.container(list)

# items of incompatible type are rejected
with pytest.raises(TypeError):

# container_method methods are available on the list
assert list_.sum() == 3
Release History

Release History

This version
History Node


History Node


History Node


History Node


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
containers-0.0.3.tar.gz (2.7 kB) Copy SHA256 Checksum SHA256 Source Apr 13, 2016

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