Issue #12 resolved

Augmented arithmetic operations (iadd, etc.) return new Dingus instead of self

Gary Bernhardt
repo owner created an issue

If I say:

{{{ d = Dingus() d += 5 }}}

I would expect to see the += (iadd) call logged on d. That's not what happens, though:


d += 5 d.calls [] }}}

When iadd isn't defined, += calls add and reassigns the local variable. So the d we check the calls for isn't actually the same d:


print d <Dingus dingus_4297687248> d += 5 print d <Dingus dingus_4297687248.add> }}}

This is very confusing. += shouldn't modify the Dingus, but should record the call.

Comments (1)

  1. Log in to comment