Why subtract a value from itself (x - x) in Python?

Posted by endolith on Stack Overflow See other posts from Stack Overflow or by endolith
Published on 2010-05-20T15:06:45Z Indexed on 2010/05/20 15:10 UTC
Read the original article Hit count: 106

Filed under:
|
|
|

In NumPy functions, there are often initial lines that do checking of variable types, forcing them to be certain types, etc. Can someone explain the point of these lines? What does subtracting a value from itself do?

t,w = asarray(t), asarray(duty)
w = asarray(w + (t-t))
t = asarray(t + (w-w))

© Stack Overflow or respective owner

Related posts about python

Related posts about type-conversion