← Back to team overview

testtools-dev team mailing list archive

[Bug 686807] Re: Having __str__ not __repr__ as part of the matcher protocol is awkward

 

** Tags added: matchers

-- 
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:
  Triaged

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/testtools/+bug/686807/+subscriptions


References