[IronPython] [python] Re: IronPython 1.1.1 wish-list?

Dino Viehland dinov at exchange.microsoft.com
Thu Jan 3 01:50:39 CET 2008


I think all of these can be fixed w/ the exception of the first two - or at least I have fixes for them.  Now I just need to make sure I haven't broken anything :).  The 1st one is probably too invasive to fix in v1.x (and is fixed in v2.0).  The 2nd one I'm not sure I understand.  I seem to be getting identical results in both IronPython & CPython:

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> object.__gt__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'object' has no attribute '__gt__'
>>> class Broken(object):
...     def __getattr__(self, name):
...             raise AttributeError(name)
...
>>>
>>> Broken().__gt__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in __getattr__
AttributeError: __gt__
>>> Broken() > 3
True
>>> ^Z


IronPython 1.1 (1.1) on .NET 2.0.50727.1433
Copyright (c) Microsoft Corporation. All rights reserved.
>>> class Broken(object):
...     def __getattr__(self, name):
...             raise AttributeError(name)
...
>>>
>>> Broken().__gt__
Traceback (most recent call last):
  File , line 0, in <stdin>##12
AttributeError: __gt__
>>> Broken() > 3
True
>>> ^Z

Am I just missing something?  It is the 1st day back since vacation :)

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
Sent: Sunday, December 23, 2007 9:25 AM
To: Discussion of IronPython
Subject: Re: [IronPython] [python] Re: IronPython 1.1.1 wish-list?

(Sorry to reply to this one - lost the original.)

Resolver is based on IronPython 1.1 - and in our test suite we have a
set of IronPython bug tests for bugs that have affected us and that we
have had to work around. Fixing these would be great.

These include (note that the tests all pass - they will fail as soon as
the bugs are fixed so that we know to remove our workarounds. To see the
correct behaviour you should reverse the asserts):

    def testExceptionRaisedInWrongPlace(self):
        class AttributeTest(object):
            def __getattr__(self, name):
                raise AttributeError('wibble')

        try:
            AttributeTest().fish
        except AttributeError, a:
            self.assertEquals(a.msg, 'fish', "AttributeError fixed")

    def testGetAttr(self):
        class Broken(object):
            def __getattr__(self, name):
                raise AttributeError(name)

        try:
            Broken().__gt__
        except AttributeError:
            pass
        else:
            self.fail("IronPython bug fixed")


    def testComparingClrObjects(self):
        self.assertNotEquals([Color.Red], [Color.Red], "IronPython has
fixed comparing clr objects in lists.")


    def testComparingSingles(self):
        self.assertFalse(1 <= Single(2.0) <= 3, "IronPython bug fixed.")

    def testCallableWithKWArgs(self):
        # IronPython bug #8246
        class F(object):
            def __call__(self, *args, **kwargs):
                print args, kwargs

        f = F()
        # Search for __call__ to find workarounds for this problem - as
of this writing
        # there is at least one use in Listener.wrap()
        self.assertRaises(Exception, lambda : f(*(1,), **{'a' : 23}))


    def testConvertFloatToLongAndFloat(self):
        self.assertFalse(hasattr(5.0, "__float__"), "Floats now have a
__float__ attribute")
        self.assertFalse(hasattr(5.0, "__long__"), "Floats now have a
__long__ attribute")


One that affects our user code:

"Array doesn't have methods w/o importing clr" - Item #       11971


We would love to see all these bugs fixed in the stable version of
IronPython. :-)

Many of these are fixed in IP 2 already.

Many Thanks

Michael Foord
http://www.manning.com/foord



HEMMI, Shigeru wrote:
> Hello,
>
> If the bug,
> http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2007-February/004500.html
> is fixed or somebody shows me a good example how to inherit "file"
> class in IronPython
> 1.1,  I will be happy.
>
> 2nd, please provide quit() function, which eases my interactive
> IronPython  session.
>
> Regards,
>
>
>
>
> 2007/12/18, Dino Viehland <dinov at exchange.microsoft.com>:
>
>>
>>
>> Are there any particular bugs you'd like to see fixed in IronPython 1.1.1?
>>
>>
>>
>> We're planning on updating the 1.1 release w/ a targeted set of bug fixes.
>> Unfortunately we've started to use the CodePlex bug list to track primarily
>> 2.0 bugs.  We can still use this to find the highest ranked bugs that aren't
>> fixed in v1.1 and target those to be back ported - but it's possible we
>> might miss something important.  So I'd thought I'd ask: what do you want
>> fixed?
>>
>>
>>
>> Note the idea here is to keep these fixes small and keep the release stable,
>> so please no fix "type(type) is type" J.  And of course if you don't know
>> how bad it'll be feel free to suggest it anyway.  Thanks!
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>

_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list