[pypy-commit] pypy more_strategies: Collapse two identical cases.

ltratt noreply at buildbot.pypy.org
Fri Nov 8 17:20:33 CET 2013


Author: Laurence Tratt <laurie at tratt.net>
Branch: more_strategies
Changeset: r67883:31b5f4d5ba4b
Date: 2013-11-08 11:34 +0000
http://bitbucket.org/pypy/pypy/changeset/31b5f4d5ba4b/

Log:	Collapse two identical cases.

	No functional change.

diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -1579,9 +1579,8 @@
                     # list.
                     raise ValueError
             return self._safe_find(w_list, intv, start, stop)
-        elif w_objt is W_StringObject or w_objt is W_UnicodeObject:
-            raise ValueError
-        elif self.space.type(w_obj).compares_by_identity():
+        elif w_objt is W_StringObject or w_objt is W_UnicodeObject \
+          or self.space.type(w_obj).compares_by_identity():
             raise ValueError
         return ListStrategy.find(self, w_list, w_obj, start, stop)
 
@@ -1635,9 +1634,8 @@
             return self._safe_find(w_list, self.unwrap(w_obj), start, stop)
         elif w_objt is W_IntObject or w_objt is W_LongObject:
             return self._safe_find(w_list, w_obj.float_w(self.space), start, stop)
-        elif w_objt is W_StringObject or w_objt is W_UnicodeObject:
-            raise ValueError
-        elif self.space.type(w_obj).compares_by_identity():
+        elif w_objt is W_StringObject or w_objt is W_UnicodeObject \
+          or self.space.type(w_obj).compares_by_identity(): 
             raise ValueError
         return ListStrategy.find(self, w_list, w_obj, start, stop)
 


More information about the pypy-commit mailing list