Skip to content

vector.__repr__ method now follows convention#231

Merged
mwcraig merged 2 commits intovpython:masterfrom
aherrera1721:master
Jun 8, 2023
Merged

vector.__repr__ method now follows convention#231
mwcraig merged 2 commits intovpython:masterfrom
aherrera1721:master

Conversation

@aherrera1721
Copy link
Copy Markdown
Contributor

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
Copy link
Copy Markdown
Contributor

mwcraig commented Jun 8, 2023

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

@mwcraig mwcraig merged commit fc50143 into vpython:master Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants