testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00364
[Bug 686807] [NEW] Having __str__ not __repr__ as part of the matcher protocol is awkward
Public bug reported:
For example, this is from MismatchesAll:
def __str__(self):
return 'MatchesAll(%s)' % ', '.join(map(str, self.matchers))
Wouldn't this:
def __repr__(self):
return 'MatchesAll(%r)' % (self.matchers, )
be much easier? This even seems more in the spirit of what __repr__ is
usually used for than what testtools does now.
** Affects: testtools
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of testtools
developers, which is subscribed to testtools.
https://bugs.launchpad.net/bugs/686807
Title:
Having __str__ not __repr__ as part of the matcher protocol is awkward
Status in testtools:
New
Bug description:
For example, this is from MismatchesAll:
def __str__(self):
return 'MatchesAll(%s)' % ', '.join(map(str, self.matchers))
Wouldn't this:
def __repr__(self):
return 'MatchesAll(%r)' % (self.matchers, )
be much easier? This even seems more in the spirit of what __repr__ is usually used for than what testtools does now.
Follow ups
References