[IronPython] Default parameters problem In IronPython 1.0

Haibo Luo haiboluo at exchange.microsoft.com
Thu Mar 9 03:16:18 CET 2006

Looks like this issue has been fixed in the coming beta4. Please wait for a few moments.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of liangml
Sent: Wednesday, March 08, 2006 5:47 PM
To: users at lists.ironpython.com
Subject: [IronPython] Default parameters problem In IronPython 1.0

Hi all:
    It seems that IronPython has a limit about default parameters. Please see this below, I don't know
why the last tow tests work well, but the first one doesn't :(

IronPython 1.0.2255 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> import System
>>> def foo(a,b,c,d=1,e=2): t=System.Text.Encoding.Default.GetBytes(c)
>>> foo("aaaa","bbbb","cccc")
Traceback (most recent call last):
  File , line 0, in input##1
  File , line 0, in foo
  File , line 0, in foo
Exception: Object reference not set to an instance of an object.
>>> def foo(a,b,c,d=1): t=System.Text.Encoding.Default.GetBytes(c)
>>> foo("aaaa","bbbb","cccc")
>>> def foo(c,d=1,e=2): t=System.Text.Encoding.Default.GetBytes(c)
>>> foo("cccc")

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060308/004e5114/attachment.html>

More information about the Ironpython-users mailing list