Oh i see, thanks for explaining Curt. I should have dug a little deeper myself, but usually its me doing something stupid and not a bug. I assumed it was my fault =) I'll open a ticket.
On 29 December 2011 16:15, Curt Hagenlocher <c...@hagenlocher.org> wrote: > This looks like a bug in IronPython when deriving a class from int. Here's > a simple repro; file a bug! > > In IronPython 2.7.1, > > >>> class Integer(int): > ... def __init__(self, value): > ... int.__init__(value) > ... > >>> Integer(10) > 10 > >>> Integer('10') > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > > TypeError: expected int, got str > >>> int('10') > 10 > >>> > > In Python 2.6, > >>> class Integer(int): > ... def __init__(self, value): > ... int.__init__(value) > ... > >>> Integer(10) > 10 > >>> Integer('10') > 10 > >>> int('10') > 10 > >>> > On Thu, Dec 29, 2011 at 7:30 AM, Chris <phatf...@gmail.com> wrote: > >> Hi, >> >> Can anyone explain this bellow. Does PyPDF use some unsported part of the >> standard lib? Because there are no external modules required for it. >> On another note, is there a way for the "Execute Project in Python >> Interactive" to use the vanilla Python interpreter rather than the >> IronPython one. I cant see a way to change this? >> >> Thanks >> >> *Python 2.7 Interactive Window* >> >> Resetting execution engine >> >>> from pyPdf import PdfFileReader >> >>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short >> numbers/2370.pdf', 'rb')) >> >>> print 'test' >> test >> >>> >> >> *IronPython 2.7 Interactive Window* >> >> >>> from pyPdf import PdfFileReader >> >>> pdf = PdfFileReader(open('D:/Chris/Documents/sorting/short >> numbers/2370.pdf', 'rb')) >> Traceback (most recent call last): >> File "<string>", line 1, in <module> >> File "C:\Program Files (x86)\IronPython >> 2.7.1\lib\site-packages\pyPdf\pdf.py", line 374, in __init__ >> self.read(stream) >> File "C:\Program Files (x86)\IronPython >> 2.7.1\lib\site-packages\pyPdf\pdf.py", line 732, in read >> num = readObject(stream, self) >> File "C:\Program Files (x86)\IronPython >> 2.7.1\lib\site-packages\pyPdf\generic.py", line 87, in readObject >> return NumberObject.readFromStream(stream) >> File "C:\Program Files (x86)\IronPython >> 2.7.1\lib\site-packages\pyPdf\generic.py", line 236, in readFromStream >> return NumberObject(name) >> TypeError: expected int, got str >> >>> >> >> _______________________________________________ >> Ironpython-users mailing list >> Ironpython-users@python.org >> http://mail.python.org/mailman/listinfo/ironpython-users >> >> >
_______________________________________________ Ironpython-users mailing list Ironpython-users@python.org http://mail.python.org/mailman/listinfo/ironpython-users