[Python-ideas] Implementation of adding dicts

julien tayon julien at tayon.net
Wed Mar 11 13:28:49 CET 2015


Hello,

Just in case I have to implementation of dict/sub/mult/div for dict.

I have chosen only one rule: + - / * should behave with the least surprise
principle which is so far linear algebrae when dealing with stuff that
looks like mathematics

Implementation 2 (trying trait and mixin)
http://archery.readthedocs.org/en/latest/bow.html
Implementation 1 (experimenting weired stuff with dict (like addition and
transforming dict with dict in a «matrix like» fashion)
http://vectordict.readthedocs.org/en/latest/algebrae.html

And the linear algebrae test:
http://vectordict.readthedocs.org/en/latest/consistent.html
And the results
https://github.com/jul/ADictAdd_iction/blob/master/docs/source/result.txt

I just noticed the dicussion, I have been using the + - / * for
aggregations for 2 years now and it is really helpful. I can give any
feedback.

I also had to overload + - for Sets ^^ and I have the cosine similarities
that works nicely out of the box with my definition
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150311/ce497787/attachment.html>


More information about the Python-ideas mailing list