[IronPython] clrtype: How to subclass ClrClass?

Lukas Cenovsky cenovsky at bakalari.cz
Sat Feb 6 12:19:51 CET 2010


Hi all,
it looks like I cannot subclass a class based on ClrClass metaclass:

IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4927
Type "help", "copyright", "credits" or "license" for more information.
 >>> import clr
 >>> import clrtype
 >>>
 >>> class Product(object):
...     __metaclass__ = clrtype.ClrClass
...
 >>> p = Product()
 >>> print "CLR type name: %s" % p.GetType().FullName
CLR type name: Product
 >>>
 >>> class MyProduct(Product):
...     pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: The given key was not present in the dictionary.

Is it a bug or am I doing something wrong? Thanks.

--
-- Lukáš





More information about the Ironpython-users mailing list