[IronPython] an unexpected keyword argument

HEMMI, Shigeru textdirected at gmail.com
Sat Sep 2 03:28:09 CEST 2006


Nobody replies, I think this is a bug.
On my MAC OS X,  I got the same output:

$ cat testingIP.py
class TEST(file):
    def __init__(self,fname,VERBOSITY=0):
        file.__init__(self,fname,"r",1)
        self.VERBOSITY = VERBOSITY
if __name__=='__main__':
    f=TEST(r'sometext.txt',VERBOSITY=1)
    print "f.VERBOSITY=",f.VERBOSITY

$ mono ipy.exe -V
IronPython 1.0.2436 on .NET 2.0.50727.42

$ mono ipy.exe testingIP.py
Traceback (most recent call last):
  File testingIP, line unknown, in Initialize
TypeError: __new__() got an unexpected keyword argument 'VERBOSITY'

$ python testingIP.py
f.VERBOSITY= 1






I wrote:
> Hello, for a code,
>
> class TEST(file):
>     def __init__(self,fname,VERBOSITY=0):
>         file.__init__(self,fname,"r",1)
>         self.VERBOSITY = VERBOSITY
> if __name__=='__main__':
>     f=TEST(r'sometext.txt',VERBOSITY=1)
>     print "f.VERBOSITY=",f.VERBOSITY
>
> I got different result:
>
> C:\home\>ipy testIPY.py
> Traceback (most recent call last):
>   File C:\cygwin\home\c1544\crcsolver\magna_examples\testIPY.py, line 6, in Init
> ialize
> TypeError: __new__() got an unexpected keyword argument 'VERBOSITY'
>
> C:home\>python testIPY.py
> f.VERBOSITY= 1
>



More information about the Ironpython-users mailing list