[pypy-svn] r64237 - pypy/trunk/pypy/doc

antocuni at codespeak.net antocuni at codespeak.net
Fri Apr 17 12:12:57 CEST 2009


Author: antocuni
Date: Fri Apr 17 12:12:57 2009
New Revision: 64237

Modified:
   pypy/trunk/pypy/doc/clr-module.txt
Log:
document more features of the clr module



Modified: pypy/trunk/pypy/doc/clr-module.txt
==============================================================================
--- pypy/trunk/pypy/doc/clr-module.txt	(original)
+++ pypy/trunk/pypy/doc/clr-module.txt	Fri Apr 17 12:12:57 2009
@@ -29,6 +29,8 @@
 
   - .NET indexers are mapped to Python __getitem__ and __setitem__;
 
+  - .NET enumerators are mapped to Python iterators.
+
 Moreover, all the usual Python features such as bound and unbound
 methods are available as well.
 
@@ -91,6 +93,27 @@
 TypeError exception is raised.
 
 
+Generic classes
+================
+
+Generic classes are fully supported.  To instantiate a generic class, you need
+to use the ``[]`` notation::
+
+    >>>> from System.Collections.Generic import List
+    >>>> mylist = List[int]()
+    >>>> mylist.Add(42)
+    >>>> mylist.Add(43)
+    >>>> mylist.Add("foo")
+    Traceback (most recent call last):
+      File "<console>", line 1, in <interactive>
+    TypeError: No overloads for Add could match
+    >>>> mylist[0]
+    42
+    >>>> for item in mylist: print item
+    42
+    43
+
+
 External assemblies and Windows Forms
 =====================================
 



More information about the Pypy-commit mailing list