Skip to main content

Traits (Mixins) to give +,/,-,* to MutableMapping

Project description

https://travis-ci.org/jul/archery.svg?branch=master

Description

It is an enhancement of MutableMapping based on Traits (Mixins). It makes dict addition therefore possible.

It currently only offers:

  • addition;

  • substraction;

  • multiplication;

  • division.

Quick Example

dict with addition used here : http://github.com/jul/yahi

It instanciate like a dict::
>>> from archery import mdict
>>> a = mdict(x=1,y=2,z=2)
It adds :) ::
>>> a+a
{'y': 4, 'x': 2, 'z': 4}
>>> a+-2
{'y': 0, 'x': -1, 'z': 0}
>>> a+.5
{'y': 2.5, 'x': 1.5, 'z': 2.5}
>>> .5+a
{'y': 2.5, 'x': 1.5, 'z': 2.5}

Resource

Ticketing: https://github.com/jul/archery/issues?state=open Source: https://github.com/jul/archery Latest documentation: http://archery.readthedocs.org/en/latest/index.html

Project details


Download files

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

Source Distribution

archery-0.1.7.tar.gz (13.1 kB view hashes)

Uploaded Source

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