Author: Manuel Jacob Branch: remove-remaining-smm Changeset: r69316:a141c6e25ef6 Date: 2014-02-24 00:35 +0100 http://bitbucket.org/pypy/pypy/changeset/a141c6e25ef6/
Log: pep8 diff --git a/pypy/objspace/std/complexobject.py b/pypy/objspace/std/complexobject.py --- a/pypy/objspace/std/complexobject.py +++ b/pypy/objspace/std/complexobject.py @@ -23,9 +23,9 @@ return False if self.user_overridden_class or w_other.user_overridden_class: return self is w_other - real1 = space.float_w(space.getattr(self, space.wrap("real"))) + real1 = space.float_w(space.getattr(self, space.wrap("real"))) real2 = space.float_w(space.getattr(w_other, space.wrap("real"))) - imag1 = space.float_w(space.getattr(self, space.wrap("imag"))) + imag1 = space.float_w(space.getattr(self, space.wrap("imag"))) imag2 = space.float_w(space.getattr(w_other, space.wrap("imag"))) real1 = float2longlong(real1) real2 = float2longlong(real2) @@ -73,7 +73,7 @@ realstart = i pc = s[i] while i < slen and s[i] != ' ': - if s[i] in ('+','-') and pc not in ('e','E') and i != realstart: + if s[i] in ('+', '-') and pc not in ('e', 'E') and i != realstart: break pc = s[i] i += 1 @@ -108,7 +108,7 @@ if imagsign == ' ': raise ValueError - i+=1 + i += 1 # whitespace while i < slen and s[i] == ' ': i += 1 @@ -118,7 +118,7 @@ imagstart = i pc = s[i] while i < slen and s[i] != ' ': - if s[i] in ('+','-') and pc not in ('e','E'): + if s[i] in ('+', '-') and pc not in ('e', 'E'): break pc = s[i] i += 1 @@ -126,14 +126,14 @@ imagstop = i - 1 if imagstop < 0: raise ValueError - if s[imagstop] not in ('j','J'): + if s[imagstop] not in ('j', 'J'): raise ValueError if imagstop < imagstart: raise ValueError - while i<slen and s[i] == ' ': + while i < slen and s[i] == ' ': i += 1 - if i < slen: + if i < slen: raise ValueError realpart = s[realstart:realstop] @@ -147,7 +147,6 @@ return realpart, imagpart - def unpackcomplex(space, w_complex, strict_typing=True): """ convert w_complex into a complex and return the unwrapped (real, imag) @@ -222,7 +221,7 @@ def __repr__(self): """ representation for debugging purposes """ - return "<W_ComplexObject(%f,%f)>" % (self.realval, self.imagval) + return "<W_ComplexObject(%f, %f)>" % (self.realval, self.imagval) def as_tuple(self): return (self.realval, self.imagval) @@ -287,7 +286,7 @@ return W_ComplexObject(w_obj.floatval, 0.0) @staticmethod - @unwrap_spec(w_real = WrappedDefault(0.0)) + @unwrap_spec(w_real=WrappedDefault(0.0)) def descr__new__(space, w_complextype, w_real, w_imag=None): from pypy.objspace.std.complexobject import W_ComplexObject @@ -297,7 +296,7 @@ # is itself a subclass of complex. noarg2 = w_imag is None if (noarg2 and space.is_w(w_complextype, space.w_complex) - and space.is_w(space.type(w_real), space.w_complex)): + and space.is_w(space.type(w_real), space.w_complex)): return w_real if space.isinstance_w(w_real, space.w_str) or \ @@ -637,4 +636,4 @@ __pow__ = interp2app(W_ComplexObject.descr_pow), conjugate = interp2app(W_ComplexObject.descr_conjugate), - ) +) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit