SciTools / biggus

:no_entry: [DEPRECATED] Virtual large arrays and lazy evaluation.
http://biggus.readthedocs.io/
GNU Lesser General Public License v3.0
54 stars 27 forks source link

Python 2 __div__ #149

Closed scmc72 closed 9 years ago

scmc72 commented 9 years ago

As discussed in #148, I have added added the necessary components for biggus to mimic Python 2 when performing division operations.

I have redefined __div__ so that it takes into account the dtype of arguments to 'properly' evaluate when using Python 2.

Note: when using Python 3, or __future__ division, nothing will change as Python 3 only uses __floordiv__ and __truediv__

I wasn't sure about where to put a test checking that / evaluates to __div__ as the unit tests for biggus.Array use __future__ division. To test this would then require a new unit test file I think?

I have added a test to check that operator.div evaluates properly which might be all that is needed?

Any thoughts would be much appreciated!