[IronPython] Default-valued arguments to C# functions

Curt Hagenlocher curt at hagenlocher.org
Sat Apr 24 05:43:03 CEST 2010


On Fri, Apr 23, 2010 at 4:57 PM, Jeff Hardy <jdhardy at gmail.com> wrote:

> I've got some functions implemented in C# that need to have optional,
> defaulted parameters. So far I've been declaring them similar to:
>
>    public object cursor(CodeContext context,
> [Optional][DefaultValue(null)]object factory)


I think you need to use DefaultValueParameter instead of DefaultValue. It's
an easy mistake to make -- I've made it myself. :(

--
Curt Hagenlocher
curt at hagenlocher.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100423/74b5b45d/attachment.html>


More information about the Ironpython-users mailing list