Comment #12 on issue 2125 by nicolas.pourcelot: Using Integers as python
slices.
http://code.google.com/p/sympy/issues/detail?id=2125
"a=S(1); b = S(2); a/b gives 1/2, not 0."
In Python 3.x, 1/2 will return 0.5, and in Python 2.x, from future import
__truediv__ is already widely used imo.
Of course, there will always be some differences between Integers and ints
(e.g. 0.5 instead of Rational(1, 2))... just like you can't expect list to
always behave like vectors or matrices (e.g. you can't multiply two lists).
For what I'm concerned, I'd like python ints to behave more like Integers,
because I develop a calculator which convert (through a parser) every
number or symbol to a sympy object.
Determining exactly where, in an arbitrary expression, an int should be
kept would be difficult...
Concerning sympy design, I think that ints and Integers are closer objects
(in term of meaning) than Vectors or lists. Vectors would be similar to
numpy arrays instead, and S(5)*numpy.array((1,2,3)) already works.
So, definitely +1 for this :)
(Edit: spelling)
--
You received this message because you are subscribed to the Google Groups
"sympy-patches" group.
To post to this group, send email to sympy-patc...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-patches?hl=en.