<html><body bgcolor="#FFFFFF"><div>Works, thank you<br></div><div><br>On 10 Jul 2008, at 17:56, Dino Viehland &lt;<a href="mailto:dinov@exchange.microsoft.com">dinov@exchange.microsoft.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>

<div class="Section1">

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">This is 1.x, correct?&nbsp; You should implement the ICodeFormattable
interface.&nbsp; That is also present in 2.0 but in 2.0 it’s no longer required that
you implement it for it to work, you can just define a method named __repr__.<o:p></o:p></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p>&nbsp;</o:p></span></p>

<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">

<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a> [<a href="mailto:users-bounces@lists.ironpython.com">mailto:users-bounces@lists.ironpython.com</a>] <b>On
Behalf Of </b>Kamil Dworakowski<br>
<b>Sent:</b> Thursday, July 10, 2008 9:53 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> [IronPython] repr on c# class<o:p></o:p></span></p>

</div>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">I need to define repr method in c#, for use in IronPython. I
tried: &nbsp;&nbsp;&nbsp; <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [PythonName("repr")]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static object Repr(object o)
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
o.ToString();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
<br>
which didn't work. Is there a way without subclassing in Python?<br>
<br>
--<br>
Kamil<o:p></o:p></p>

</div>




</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Users mailing list</span><br><span><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a></span><br><span><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a></span><br></div></blockquote></body></html>