[IronPython] C#, Types and IronPython

Michael Foord fuzzyman at voidspace.org.uk
Sun Mar 11 15:45:55 CET 2007


Nicholas Riley wrote:
> On Sat, Mar 10, 2007 at 01:34:32PM +0000, Michael Foord wrote:
>   
>> I have some C# that is getting at type objects in several different 
>> ways, and I would like to know the difference.
>>
>> Type.GetType("int")
>> typeof(int)
>>
>> and I think :
>>
>> int.GetType()
>>     
>
> In IronPython this is asking for the type of 'int' here, not the type
> of _an_ int.  In C# it does both.
>
>   

Right - but what I want to do is get the type object for 'int' that 
would be returned by that call in C#.

I realise that what Python understands as 'int' is a different thing to 
what C# understands as int.

Thanks for the other info. I see that 'Type.GetType' works when you pass 
in a fully qualified type name - but I swear I saw an example in C# that 
didn't. I'm trying to find it now and failing ! I give up. Perhaps I 
hallucinated it.

All the best,

Fuzzyman
http://www.voidspace.org.uk/ironpython/



More information about the Ironpython-users mailing list