Author: Manuel Jacob Branch: remove-set-smm Changeset: r64134:f0181cff601c Date: 2013-05-15 11:28 +0200 http://bitbucket.org/pypy/pypy/changeset/f0181cff601c/
Log: Change comment. Move descr_repr up. 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 @@ -161,7 +161,14 @@ """ Removes an arbitrary element from the set. May raise KeyError if set is empty.""" return self.strategy.popitem(self) - # app-level operations (non-mutating) + # app-level operations + + 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_eq(self, space, w_other): if isinstance(w_other, W_BaseSetObject): @@ -242,13 +249,6 @@ 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_and(self, space, w_other): return self.intersect(w_other) @@ -369,8 +369,6 @@ return space.w_False return space.w_True - # app-level operations (mutating) - def descr_add(self, space, w_other): """Add an element to a set.\n\nThis has no effect if the element is already present.""" self.add(w_other) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit