Re: [pypy-dev] behaviour difference int-subclasses pypy 1.5 to cpython 2.6.6.

2011-08-16 Thread Armin Rigo
Hi Michael, On Tue, Aug 16, 2011 at 2:06 PM, Michael Foord wrote: > I assume the difference is that int has an __init__ method on pypy. No, it doesn't; the issue is that the call int.__init__("12") is not strictly equivalent to object.__init__("12"). It is on CPython, but that's a bit by chance

Re: [pypy-dev] behaviour difference int-subclasses pypy 1.5 to cpython 2.6.6.

2011-08-16 Thread Michael Foord
On 16 August 2011 12:32, Massa, Harald Armin wrote: > On Tue, Aug 16, 2011 at 11:59 AM, Massa, Harald Armin >> wrote: >> class fisch(int): >> > ... def __init__(self, value): >> > ... int.__init__(value) >> >> You probably mean "int.__init__(self, value)" here. Your code is bug

Re: [pypy-dev] behaviour difference int-subclasses pypy 1.5 to cpython 2.6.6.

2011-08-16 Thread Massa, Harald Armin
> > On Tue, Aug 16, 2011 at 11:59 AM, Massa, Harald Armin > 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 :) m

Re: [pypy-dev] behaviour difference int-subclasses pypy 1.5 to cpython 2.6.6.

2011-08-16 Thread Armin Rigo
Hi, On Tue, Aug 16, 2011 at 11:59 AM, Massa, Harald Armin wrote: class fisch(int): > ...     def __init__(self, value): > ...         int.__init__(value) You probably mean "int.__init__(self, value)" here. Your code is buggy :-) It works on CPython anyway, which is a bit strange in my opi

[pypy-dev] behaviour difference int-subclasses pypy 1.5 to cpython 2.6.6.

2011-08-16 Thread Massa, Harald Armin
cPython 2.6.6 is able to initialize subclassed int-objects from strings: Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class fisch(int): ... def __init__(self, value): ...