[pypy-svn] r17449 - pypy/dist/pypy/annotation
pedronis at codespeak.net
pedronis at codespeak.net
Sun Sep 11 02:34:37 CEST 2005
Author: pedronis
Date: Sun Sep 11 02:34:36 2005
New Revision: 17449
Modified:
pypy/dist/pypy/annotation/model.py
pypy/dist/pypy/annotation/unaryop.py
Log:
disable this changes until there are tests for them, especially about why bool comparison needed to be changed
sorry, but changing the annotator without a trail of tests that allow to understand what is going on is not a good idea
Modified: pypy/dist/pypy/annotation/model.py
==============================================================================
--- pypy/dist/pypy/annotation/model.py (original)
+++ pypy/dist/pypy/annotation/model.py Sun Sep 11 02:34:36 2005
@@ -171,20 +171,20 @@
unsigned = False
def __init__(self):
pass
- def __eq__(self, other):
- if self.__class__ is not other.__class__:
- return False
- if 'knowntypedata' in self.__dict__:
- selfdic = self.__dict__.copy()
- del selfdic['knowntypedata']
- else:
- selfdic = self.__dict__
- if 'knowntypedata' in other.__dict__:
- otherdic = other.__dict__.copy()
- del otherdic['knowntypedata']
- else:
- otherdic = other.__dict__
- return selfdic == otherdic
+ #def __eq__(self, other):
+ # if self.__class__ is not other.__class__:
+ # return False
+ # if 'knowntypedata' in self.__dict__:
+ # selfdic = self.__dict__.copy()
+ # del selfdic['knowntypedata']
+ # else:
+ # selfdic = self.__dict__
+ # if 'knowntypedata' in other.__dict__:
+ # otherdic = other.__dict__.copy()
+ # del otherdic['knowntypedata']
+ # else:
+ # otherdic = other.__dict__
+ # return selfdic == otherdic
class SomeString(SomeObject):
"Stands for an object which is known to be a string."
Modified: pypy/dist/pypy/annotation/unaryop.py
==============================================================================
--- pypy/dist/pypy/annotation/unaryop.py (original)
+++ pypy/dist/pypy/annotation/unaryop.py Sun Sep 11 02:34:36 2005
@@ -370,22 +370,22 @@
def method_upper(str):
return SomeString()
- def is_true(str):
- r = SomeObject.is_true(str)
- if not isinstance(r, SomeBool):
- return r
- bk = getbookkeeper()
- knowntypedata = r.knowntypedata = {}
- fn, block, i = bk.position_key
-
- annotator = bk.annotator
- op = block.operations[i]
- assert op.opname == "is_true" or op.opname == "nonzero"
- assert len(op.args) == 1
- arg = op.args[0]
- add_knowntypedata(knowntypedata, False, [arg], str)
- add_knowntypedata(knowntypedata, True, [arg], str.nonnoneify())
- return r
+ #def is_true(str):
+ # r = SomeObject.is_true(str)
+ # if not isinstance(r, SomeBool):
+ # return r
+ # bk = getbookkeeper()
+ # knowntypedata = r.knowntypedata = {}
+ # fn, block, i = bk.position_key
+ #
+ # annotator = bk.annotator
+ # op = block.operations[i]
+ # assert op.opname == "is_true" or op.opname == "nonzero"
+ # assert len(op.args) == 1
+ # arg = op.args[0]
+ # add_knowntypedata(knowntypedata, False, [arg], str)
+ # add_knowntypedata(knowntypedata, True, [arg], str.nonnoneify())
+ # return r
More information about the Pypy-commit
mailing list