Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliased __str__ to __repr__ #1048

Merged
merged 6 commits into from Jan 11, 2017
Merged

Aliased __str__ to __repr__ #1048

merged 6 commits into from Jan 11, 2017

Conversation

jlstevens
Copy link
Contributor

PR implementing the suggestion in #966. The code change is tiny (aliasing __str__ to __repr__) and most of this PR will be about updating the docs.

Here is the behavior before:

image

And after:

image

Of course I'll make sure to put the parens around print in the notebooks for Python 3 support!

@jlstevens
Copy link
Contributor Author

I've now updated all the notebooks using print(repr(..)) and I have been careful to make sure the notebook tests kept passing.

Unfortunately, there are two notebooks with fixes that I do expect will result in test failures. These involve use of naked repr(..) which should result in different output (due to extra quotes compared to print).

@jlstevens
Copy link
Contributor Author

As expected the tests failed. I thought only one cell would fail, but as repr returns a string whereas print outputs to standard output, the test data is now shifted. Rebuilding the test data now.

@jlstevens
Copy link
Contributor Author

Now the test data has been updated, the pr build passed and the push build failed (as expected). Ready to review/merge.

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Happy to merge.

@philippjfr philippjfr merged commit 28db99d into master Jan 11, 2017
@philippjfr philippjfr deleted the str_is_repr branch January 27, 2017 02:53
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.

None yet

2 participants