<div>Well in the example I gave, the type of class foo would genrally be something like&nbsp; IronPython.NewTypes.System.Object_1$2.&nbsp; There&#39;s not going to be any &quot;native&quot; CLR code to which you can pass a List&lt;IronPython.NewTypes.System.Object_1$2&gt;, and if you&#39;re passing the data to other Python code, you may as well do it as a Python list or tuple.&nbsp; It&#39;s the &quot;dynamic&quot; thing to do :).</div>

<div>&nbsp;</div>
<div>List&lt;IronPython.NewTypes.System.Object_1$2&gt; isn&#39;t even type-safe for Python classes because IronPython maintains a cache of generated types and will reuse a type it has previously generated for any new class you define that&#39;s compatible with a previously-defined class.</div>

<div><br>&nbsp;</div>
<div class="gmail_quote">On Fri, May 2, 2008 at 9:58 PM, Matthew Barnard &lt;<a href="mailto:m.stephen.barnard@gmail.com">m.stephen.barnard@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Thanks Curt, in C# I use generics (list &amp; dict) containing class instances quite often. Is there a caveat to the dynamic typing that I&#39;m missing? 
<div>
<div></div>
<div class="Wj3C7c"><br><br><br>
<div class="gmail_quote">On Fri, May 2, 2008 at 7:52 PM, Curt Hagenlocher &lt;<a href="mailto:curt@hagenlocher.org" target="_blank">curt@hagenlocher.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>This will get you a CLR type directly from your class object:</div>
<div>&nbsp;</div>
<div><font face="courier new,monospace">class foo(object):</font></div>
<div><font face="courier new,monospace">&nbsp;&nbsp;&nbsp; pass</font></div>
<div><font face="courier new,monospace">theType = clr.GetClrType(foo)</font></div>
<div>&nbsp;</div>
<div>What use do you have for creating a generic with the resulting (dynamically-generated) type?<br><br></div>
<div class="gmail_quote">
<div>
<div></div>
<div>On Fri, May 2, 2008 at 6:30 PM, Matthew Barnard &lt;<a href="mailto:m.stephen.barnard@gmail.com" target="_blank">m.stephen.barnard@gmail.com</a>&gt; wrote:<br></div></div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>
<div></div>
<div>Is the following the only way to create a generic containing a python class?<br><br><br>from System.Collections.Generic import List<br>from System import Type<br><br>class Foo:<br>&nbsp;&nbsp;&nbsp; &gt;&gt;class stuff&lt;&lt;<br>
<br>l = List[Type.GetType(Foo())]()<br><br><br>I assume this is the nature of dynamic typing, but is there a way to get the type from the classobj, and not an instance?<br><br></div></div>_______________________________________________<br>
Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">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><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">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><br clear="all"><br></div></div><font color="#888888">-- <br>___________________________<br>Matthew Barnard<br>602 540 0652 </font><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>