[IronPython] .NET casts in IronPython
Curt Hagenlocher
curt at hagenlocher.org
Fri Mar 27 00:35:00 CET 2009
The Python object will always reflect the underlying .NET type, so you never
need to upcast or downcast.
2009/3/26 Carolyn Johnston (MSNAR) <carolj at microsoft.com>
> You are right, I didn’t need to do the cast – was just transcribing some
> C# code that did that for some reason.
>
>
>
> However, it is still a good question (instead of upcasting, think of
> downcasting), and the answer isn’t out there that I could find.
>
>
>
> Thanks, Carolyn
>
>
>
> *Carolyn Johnston (carolj)*
> Lead Researcher, MSN Applied Research Text group
> Bldg 109/4053 | MIcrosoft Corporation
> 425-706-2153
>
>
>
> *From:* users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland
> *Sent:* Thursday, March 26, 2009 1:59 PM
> *To:* Discussion of IronPython
> *Subject:* Re: [IronPython] .NET casts in IronPython
>
>
>
> Why do you need to cast to the base class? All of the members you need
> should already be there.
>
>
>
> *From:* users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] *On Behalf Of *Carolyn Johnston
> (MSNAR)
> *Sent:* Thursday, March 26, 2009 3:47 PM
> *To:* Users at lists.ironpython.com
> *Subject:* [IronPython] .NET casts in IronPython
>
>
>
> I need to cast a .NET object A to a .NET object B. There is nothing tricky
> about the cast, it’s a straightforward cast to a base type. How can I do
> this in IP?
>
>
>
> Thanks!
>
> J Carolyn
>
>
>
> *Carolyn Johnston (carolj)*
> Lead Researcher, MSN Applied Research Text group
> Bldg 109/4053 | MIcrosoft Corporation
> 425-706-2153
>
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090326/3913dfd2/attachment.html>
More information about the Ironpython-users
mailing list