[pypy-dev] Pypy bugs
Elefterios Stamatogiannakis
estama at gmail.com
Sun May 8 03:13:57 CEST 2011
Hi all, and many many thanks for pypy. Your work on pypy is exceptional.
Due to Roger Binns doing the first steps of porting APSW on top of pypy,
i've tried my project (madIS: http://code.google.com/p/madis ) with pypy
and head APSW, and found the following:
In python 2.7.1:
In [1]: print dict.__setattr__
<slot wrapper '__setattr__' of 'object' objects>
In pypy 1.5:
In [10]: print dict.__setattr__
<unbound method dict.__setattr__>
In essence in python 2.7.1 dict.__setattr__ is the same as
object.__setattr__ whereas in pypy dict.__setattr__ works only with
dictionaries, so it throws the following error when called with an object:
TypeError: unbound method __setattr__() must be called with dict
instance as first argument
Above problem was solved by changing all dict.__setattr__ invocations
into object.__setattr__ invocations, and now the same code works in both
CPython and pypy.
The second problem that i found with pypy is this:
In [12]: import xml.etree.c
xml.etree.cElementTree
Above is to show that cElementTree exists in pypy's xml.etree. If then i
try to import cElementTree:
In [11]: import xml.etree.cElementTree
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/home/estama/programs/pypy-15/bin/<ipython console> in <module>()
/home/estama/programs/pypy-15/lib-python/2.7/xml/etree/cElementTree.pyc
in <module>()
1 # Wrapper module for _elementtree
2
----> 3 from _elementtree import *
ImportError: No module named _elementtree
Thanks again for pypy, and to Roger Binns for your outstanding work on APSW.
lefteris.
More information about the pypy-dev
mailing list