[pypy-dev] PyPy newbie question: How to play with types
Noam Raphael
noamraph at gmail.com
Fri Nov 18 13:32:28 CET 2005
Ok, I just tried to add the "frozen" multimethod. I managed to make it
work as a one-argument function. I had to add a line to the
flow/operation.py, to make it work:
('frozen', None),
I then tried to make it a function which gets two arguments, the
second one is optional (so you can call frozen(x), which means
x.__frozen__(), and also frozen(x, y), which means x.__frozen__(y).) I
replaced the "1" with "2" in the line in baseobjspace.py, and it
didn't work - it said:
Traceback (most recent call last):
File "pypy/bin/py.py", line 205, in ?
sys.exit(main_(sys.argv))
File "pypy/bin/py.py", line 81, in main_
space = make_objspace(Options)
File "pypy/bin/py.py", line 58, in make_objspace
from pypy.objspace.std import Space
File "/home/noam/sand/pypy/pypy/objspace/std/__init__.py", line 1, in ?
from objspace import StdObjSpace
File "/home/noam/sand/pypy/pypy/objspace/std/objspace.py", line 11, in ?
from pypy.objspace.descroperation import DescrOperation
File "/home/noam/sand/pypy/pypy/objspace/descroperation.py", line 573, in ?
raise Exception, "missing def for operation%s" % _name
Exception: missing def for operationfrozen
Another thing that I had to find out: I had to copy the "py" directory
from the bz2 distribution in order to make pypy work (I checked out
from subversion). I didn't see it mentioned in the subversion
instructions.
I will probably have more questions in the future, but that's it for now...
Thanks again,
Noam
More information about the Pypy-dev
mailing list