[pypy-commit] pypy default: merge heads, not clear what happened
mattip
pypy.commits at gmail.com
Fri Mar 11 08:28:41 EST 2016
Author: mattip <matti.picus at gmail.com>
Branch:
Changeset: r82969:8357c9e1778f
Date: 2016-03-11 15:25 +0200
http://bitbucket.org/pypy/pypy/changeset/8357c9e1778f/
Log: merge heads, not clear what happened
diff --git a/pypy/objspace/std/stringmethods.py b/pypy/objspace/std/stringmethods.py
--- a/pypy/objspace/std/stringmethods.py
+++ b/pypy/objspace/std/stringmethods.py
@@ -609,13 +609,16 @@
def descr_startswith(self, space, w_prefix, w_start=None, w_end=None):
(value, start, end) = self._convert_idx_params(space, w_start, w_end)
if space.isinstance_w(w_prefix, space.w_tuple):
- for w_prefix in space.fixedview(w_prefix):
- if self._startswith(space, value, w_prefix, start, end):
- return space.w_True
- return space.w_False
+ return self._startswith_tuple(space, value, w_prefix, start, end)
return space.newbool(self._startswith(space, value, w_prefix, start,
end))
+ def _startswith_tuple(self, space, value, w_prefix, start, end):
+ for w_prefix in space.fixedview(w_prefix):
+ if self._startswith(space, value, w_prefix, start, end):
+ return space.w_True
+ return space.w_False
+
def _startswith(self, space, value, w_prefix, start, end):
prefix = self._op_val(space, w_prefix)
if start > len(value):
More information about the pypy-commit
mailing list