Fix pypy repr for DomainSpecificString

This commit is contained in:
Erik Johnston 2016-04-11 10:58:24 +01:00
parent 58de897c77
commit 6c11bb956c
2 changed files with 7 additions and 2 deletions

View file

@ -109,7 +109,7 @@ class SyncRestServlet(RestServlet):
full_state = parse_boolean(request, "full_state", default=False)
logger.info(
"/sync: user=%r, timeout=%r, since=%r,"
"/sync: user=%s, timeout=%r, since=%r,"
" set_presence=%r, filter_id=%r" % (
user, timeout, since, set_presence, filter_id
)

View file

@ -37,7 +37,7 @@ class DomainSpecificString(
# set by:
# users = set(user)
def __iter__(self):
raise ValueError("Attempted to iterate a %s" % (type(self).__name__,))
raise ValueError("Attempted to iterate a %s" % (type(self).__name__,),)
# Because this class is a namedtuple of strings and booleans, it is deeply
# immutable.
@ -83,6 +83,11 @@ class DomainSpecificString(
__str__ = to_string
def __repr__(self):
return "%r(%r, %r)" % (
type(self).__name__, self.localpart, self.domain,
)
@classmethod
def create(cls, localpart, domain,):
return cls(localpart=localpart, domain=domain)