Skip to content

Commit

Permalink
Merge pull request #782 from jabooth/repr_show_str
Browse files Browse the repository at this point in the history
__repr__ return __str__ for all Copyable objects
  • Loading branch information
Patrick Snape committed Feb 8, 2017
2 parents f7866e6 + 614023d commit 473bfc8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions menpo/base.py
Expand Up @@ -37,6 +37,14 @@ def copy(self):
new.__dict__[k] = v
return new

def __repr__(self):
# Most classes in Menpo derive from Copyable, so it's a handy place
# to implement Menpo-wide behavior. For use in the notebook, we find
# __repr__ representations not of very much use, so we default to
# showing the string representation for this case. See
# https://github.com/menpo/menpo/issues/752 for discussion.
return self.__str__()


class Vectorizable(Copyable):
"""
Expand Down

0 comments on commit 473bfc8

Please sign in to comment.