On 16 August 2011 12:32, Massa, Harald Armin <c...@ghum.de> wrote: > On Tue, Aug 16, 2011 at 11:59 AM, Massa, Harald Armin <c...@ghum.de> >> wrote: >> >>>> class fisch(int): >> > ... def __init__(self, value): >> > ... int.__init__(value) >> >> You probably mean "int.__init__(self, value)" here. Your code is buggy >> :-) >> > > just submitted the fix to the pyPdf author :) my workaround was > > def __init__(self, value): > int.__init__(int(value)) > .. so that I could run it under PyPy :) > > Given that int doesn't *have* an __init__ method, just omitting that call altogether is a better fix. (int objects use __new__ for construction and have no post construction initialisation.)
> so, I understand that the cPython behaviour is rather buggy. Good to have > another Python implementation :) > Well, it isn't buggy. The call is equivalent to: object.__init__("12") This just does nothing as "12" is a valid instance of object... I assume the difference is that int has an __init__ method on pypy. Michael > Thanks for the fast response, > > Harald > > -- > GHUM GmbH > Harald Armin Massa > Spielberger Straße 49 > 70435 Stuttgart > 0173/9409607 > > Amtsgericht Stuttgart, HRB 734971 > - > persuadere. > et programmare > > _______________________________________________ > pypy-dev mailing list > pypy-dev@python.org > http://mail.python.org/mailman/listinfo/pypy-dev > > -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev