Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Text class: changed __str__ method and added __repr__ method #6068
Conversation
mdboom
added the
needs_review
label
Feb 27, 2016
|
|
|
I was going on what was requested in #6042, however I can't think of when it would be useful for |
|
I like the option of just dropping |
|
|
tacaswell
added a commit
that referenced
this pull request
Feb 28, 2016
|
|
tacaswell |
90a6984
|
tacaswell
merged commit 90a6984
into matplotlib:master
Feb 28, 2016
tacaswell
removed the
needs_review
label
Feb 28, 2016
|
Thanks! On Sun, Feb 28, 2016, 10:35 Jon Charest notifications@github.com wrote:
|
jonchar commentedFeb 27, 2016
This should address #6042
According to the Python docs for
__repr__and__str__:print()will output what is returned by__str__, while__repr__should return a string that looks like a valid python expression. The text class currently has a__str__but no__repr__. This changes the existing__str__method into__repr__(which returnsText(x_coord, y_coord, "string")) and adds a new__str__method that returnsself._text, which achieves the behavior requested in #6042 .This would result in the following behavior:
Thoughts?