brownplt / lambda-py

Other
58 stars 10 forks source link

* operator fails with instances of an int subclass #60

Closed amtriathlon closed 11 years ago

amtriathlon commented 11 years ago

This fragment, which is currently commented out, in test_dynamics.py (added in https://github.com/brownplt/lambda-py/commit/01b15fde518d36aa565703cf31b013beb50942a6) shows the problem:

# Test handling of int*seq and seq*int
class I(int):
    pass
___assertEqual("a"*I(2), "aa")
___assertEqual(I(2)*"a", "aa")
___assertEqual(2*I(3), 6)
___assertEqual(I(3)*2, 6)
___assertEqual(I(3)*I(2), 6)

The error reported is: object has no "int" attribute