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

This version
History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(2.7 kB) Copy SHA256 Hash SHA256
Source None Apr 13, 2016

Supported By

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 Google Google Cloud Servers DreamHost DreamHost Log Hosting