[pypy-commit] pypy s390x-backend: merged default

plan_rich noreply at buildbot.pypy.org
Mon Nov 23 02:48:25 EST 2015


Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r80849:d454a5a7d9cd
Date: 2015-11-23 08:48 +0100
http://bitbucket.org/pypy/pypy/changeset/d454a5a7d9cd/

Log:	merged default

diff --git a/rpython/annotator/bookkeeper.py b/rpython/annotator/bookkeeper.py
--- a/rpython/annotator/bookkeeper.py
+++ b/rpython/annotator/bookkeeper.py
@@ -168,9 +168,7 @@
         return desc.getuniqueclassdef()
 
     def new_exception(self, exc_classes):
-        clsdefs = set()
-        for cls in exc_classes:
-            clsdefs.add(self.getuniqueclassdef(cls))
+        clsdefs = {self.getuniqueclassdef(cls) for cls in exc_classes}
         return SomeException(clsdefs)
 
     def getlistdef(self, **flags_if_new):
diff --git a/rpython/annotator/model.py b/rpython/annotator/model.py
--- a/rpython/annotator/model.py
+++ b/rpython/annotator/model.py
@@ -461,10 +461,7 @@
 
     def intersection(self, other):
         assert isinstance(other, SomeExceptCase)
-        classdefs = set()
-        for c in self.classdefs:
-            if c.issubclass(other.case):
-                classdefs.add(c)
+        classdefs = {c for c in self.classdefs if c.issubclass(other.case)}
         if classdefs:
             return SomeException(classdefs)
         else:
@@ -472,10 +469,7 @@
 
     def difference(self, other):
         assert isinstance(other, SomeExceptCase)
-        classdefs = set()
-        for c in self.classdefs:
-            if not c.issubclass(other.case):
-                classdefs.add(c)
+        classdefs = {c for c in self.classdefs if not c.issubclass(other.case)}
         if classdefs:
             return SomeException(classdefs)
         else:


More information about the pypy-commit mailing list