vpython / vpython-jupyter

3D visualization made easy
MIT License
142 stars 64 forks source link

vector.__repr__ method now follows convention #231

Closed aherrera1721 closed 1 year ago

aherrera1721 commented 1 year ago

This PR updates the vector.__repr__ method to follow the Python convention which states, "If at all possible, [the returned value] should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment)."

Now, calling eval(repr(v)) (where v is a vector) returns an equivalent vector.

mwcraig commented 1 year ago

Thanks @aherrera1721 for raising this issue and fixing it so quickly!