[pypy-dev] rpython questions, **kw, __call__, __getattr__

Hart's Antler bhartsho at yahoo.com
Fri Jul 23 06:49:53 CEST 2010

Looking through the pypy source code i see **kw, __call__ and __getattr__ are used, but when i try to write my own rpython code that uses these conventions, i get translation errors.  Do i need to borrow from "application space" in order to do this or can i just give hints to the annotator?

#this is allowed
def func(*args): print(args)

#but this is not?
def func(**kw): print(args)
#error call pattern too complex

#this class fails to translate, are we not allowed to define our own __call__ and __getattr__ in rpython?
class A(object):
  __call__(*args): print(args)
  __getattr__(self,name): print(name)

More information about the Pypy-dev mailing list