The Python object will always reflect the underlying .NET type, so you never need to upcast or downcast.<br><br>
<div class="gmail_quote">2009/3/26 Carolyn Johnston (MSNAR) <span dir="ltr">&lt;<a href="mailto:carolj@microsoft.com">carolj@microsoft.com</a>&gt;</span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div lang="EN-US" vlink="purple" link="blue">
<div>
<p><span style="COLOR: #1f497d">You are right, I didn’t need to do the cast – was just transcribing some C# code that did that for some reason. </span></p>
<p><span style="COLOR: #1f497d"> </span></p>
<p><span style="COLOR: #1f497d">However, it is still a good question (instead of upcasting, think of downcasting), and the answer isn’t out there that I could find. </span></p>
<p><span style="COLOR: #1f497d"> </span></p>
<p><span style="COLOR: #1f497d">Thanks, Carolyn</span></p>
<p><span style="COLOR: #1f497d"> </span></p>
<div>
<p><b><span style="COLOR: #7030a0; FONT-SIZE: 8pt">Carolyn Johnston (carolj)</span></b><span style="COLOR: #7030a0; FONT-SIZE: 8pt"><br>Lead Researcher, MSN Applied Research Text group <br>Bldg 109/4053 | MIcrosoft Corporation</span><span style="COLOR: #262626; FONT-SIZE: 8pt"><br>
</span><span style="COLOR: #7030a0; FONT-SIZE: 8pt">425-706-2153</span><span style="COLOR: #1f497d"></span></p></div>
<p><span style="COLOR: #1f497d"> </span></p>
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p><b><span style="FONT-SIZE: 10pt">From:</span></b><span style="FONT-SIZE: 10pt"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Dino Viehland<br>
<b>Sent:</b> Thursday, March 26, 2009 1:59 PM<br><b>To:</b> Discussion of IronPython<br><b>Subject:</b> Re: [IronPython] .NET casts in IronPython</span></p></div></div>
<p> </p>
<p><span style="COLOR: #1f497d">Why do you need to cast to the base class?  All of the members you need should already be there.</span></p>
<p><span style="COLOR: #1f497d"> </span></p>
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p><b><span style="FONT-SIZE: 10pt">From:</span></b><span style="FONT-SIZE: 10pt"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Carolyn Johnston (MSNAR)<br>
<b>Sent:</b> Thursday, March 26, 2009 3:47 PM<br><b>To:</b> <a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br><b>Subject:</b> [IronPython] .NET casts in IronPython</span></p></div>
</div>
<p> </p>
<p>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?</p>
<p> </p>
<p>Thanks!</p>
<p><span style="FONT-FAMILY: Wingdings">J</span> Carolyn</p>
<p> </p>
<p><b><span style="COLOR: #7030a0; FONT-SIZE: 8pt">Carolyn Johnston (carolj)</span></b><span style="COLOR: #7030a0; FONT-SIZE: 8pt"><br>Lead Researcher, MSN Applied Research Text group <br>Bldg 109/4053 | MIcrosoft Corporation</span><span style="COLOR: #262626; FONT-SIZE: 8pt"><br>
</span><span style="COLOR: #7030a0; FONT-SIZE: 8pt">425-706-2153</span></p>
<p> </p>
<p> </p></div></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>