[pypy-dev] unionof and dictionaries
Amaury Forgeot D Arc
Amaury.Forgeotdarc at Ubitrade.Com
Tue Sep 13 14:17:47 CEST 2005
Hello,
While playing with the annotator/translator, I found
a strange test case.
The following code works:
from pypy.annotation.model import *
from pypy.annotation.dictdef import DictDef
def test_dictdef():
def1 = DictDef(None, SomeInteger(), SomeInteger())
def2 = DictDef(None, SomeInteger(), SomeInteger())
dic1 = SomeDict(def1)
dic2 = SomeDict(def2)
assert not dic1 == dic2
assert not dic1.contains(dic2)
x = unionof(dic1, dic2)
assert dic1 == dic2 # !!!!!!!
assert dic1.contains(dic2) # !!!!!!!
Is the "unionof" function expected to have side-effects?
Are the first two tests even correct? I would expect that
two dicts defined the same way would compare equal.
--
Amaury Forgeot d'Arc
Ubix Development
www.ubitrade.com
More information about the Pypy-dev
mailing list