[pypy-svn] r7631 - pypy/trunk/src/pypy/annotation
hpk at codespeak.net
hpk at codespeak.net
Tue Nov 23 18:13:34 CET 2004
Author: hpk
Date: Tue Nov 23 18:13:34 2004
New Revision: 7631
Modified:
pypy/trunk/src/pypy/annotation/binaryop.py
Log:
union(SomeInstance, SomeInstance) return the newer revision
in case they are talking about the same classdef
Modified: pypy/trunk/src/pypy/annotation/binaryop.py
==============================================================================
--- pypy/trunk/src/pypy/annotation/binaryop.py (original)
+++ pypy/trunk/src/pypy/annotation/binaryop.py Tue Nov 23 18:13:34 2004
@@ -254,10 +254,14 @@
class __extend__(pairtype(SomeInstance, SomeInstance)):
def union((ins1, ins2)):
+ if ins1.classdef == ins2.classdef:
+ if ins1.revision > ins2.revision:
+ return ins1
+ else:
+ return ins2
basedef = ins1.classdef.commonbase(ins2.classdef)
return SomeInstance(basedef)
-
class __extend__(pairtype(SomeIterator, SomeIterator)):
def union((iter1, iter2)):
More information about the Pypy-commit
mailing list