Skip to main content
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 notifications

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

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page