[IronPython] Quick questions about connecting to other CLR languages

Dino Viehland dinov at exchange.microsoft.com
Thu Jul 6 01:56:05 CEST 2006


You can pass a type object from Python directly to the function, and we'll convert it into the CLR type along the way.  Alternately you can import clr and then do clr.GetClrType(somePythonType).  For example you should be able to pass str, int, bool, etc... through and have it just work.

Generic functions are accessed from IronPython using indexers ([]) to specify the type.  So you can do:

foo.blah[int](3, 4)

or

foo.blah[str]("3","5")

and you can access generic types the same way.



-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke
Sent: Wednesday, July 05, 2006 4:45 PM
To: Discussion of IronPython
Subject: [IronPython] Quick questions about connecting to other CLR languages

I'm writing in IP and trying to connect to code written in C# by other people

if they have a function wanting a typeof(something) argument, how can I pass that from IP?

if they have a templated function blah<t>() how will that appear in IP?
as multiple functions, or...?

thanks
KB

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
_______________________________________________
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