Author: Manuel Jacob Branch: remove-set-smm Changeset: r64132:c19c1e7f2798 Date: 2013-05-15 11:22 +0200 http://bitbucket.org/pypy/pypy/changeset/c19c1e7f2798/
Log: Remove set.__repr__ multi-method. diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py --- a/pypy/objspace/std/setobject.py +++ b/pypy/objspace/std/setobject.py @@ -242,6 +242,13 @@ return space.newbool(self.has_key(w_f)) raise + def descr_repr(self, space): + ec = space.getexecutioncontext() + w_currently_in_repr = ec._py_repr + if w_currently_in_repr is None: + w_currently_in_repr = ec._py_repr = space.newdict() + return setrepr(space, w_currently_in_repr, self) + def descr_copy(self, space): """Return a shallow copy of a set.""" if type(self) is W_FrozensetObject: @@ -439,6 +446,7 @@ Build an unordered collection.""", __new__ = gateway.interp2app(W_SetObject.descr_new), + __repr__ = gateway.interp2app(W_BaseSetObject.descr_repr), __hash__ = None, # comparison operators @@ -532,6 +540,7 @@ Build an immutable unordered collection.""", __new__ = gateway.interp2app(W_FrozensetObject.descr_new), + __repr__ = gateway.interp2app(W_BaseSetObject.descr_repr), __hash__ = gateway.interp2app(W_FrozensetObject.descr_hash), # comparison operators @@ -1582,15 +1591,6 @@ setrepr = app.interphook("setrepr") -def repr__Set(space, w_set): - ec = space.getexecutioncontext() - w_currently_in_repr = ec._py_repr - if w_currently_in_repr is None: - w_currently_in_repr = ec._py_repr = space.newdict() - return setrepr(space, w_currently_in_repr, w_set) - -repr__Frozenset = repr__Set - app = gateway.applevel(""" def setreduce(s): dict = getattr(s,'__dict__', None) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit