[IronPython] How do you call a generic method that requires more than one generic argument?

Dan Eloff dan.eloff at gmail.com
Tue Dec 30 16:54:10 CET 2008


>>> from System import Action
>>> f = lambda x, y: x+y
>>> Action[object, object](f)
ValueError: The type or method has 1 generic parameter(s), but 2
generic argument(s) were provided. A generic argument must be provided
for each generic parameter.
>>> Action[(object, object)](f)
ValueError: The type or method has 1 generic parameter(s), but 2
generic argument(s) were provided. A generic argument must be provided
for each generic parameter.
>>> Action[[object,object]](f)
TypeError: expected Array[Type], got list
>>> from System import Array, Type
>>> Action[Array[Type]([object, object])](f)
ValueError: The type or method has 1 generic parameter(s), but 2
generic argument(s) were provided. A generic argument must be provided
for each generic parameter.

Is this a bug?

Thanks,
-Dan



More information about the Ironpython-users mailing list