[IronPython] clrtype: How to subclass ClrClass?

2010-02-06 Thread Lukas Cenovsky

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áš


___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] clrtype: How to subclass ClrClass?

2010-02-06 Thread Shri Borde
It is a know bug. I can take a look next week.

-Original Message-
From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Michael Foord
Sent: Saturday, February 06, 2010 4:10 AM
To: Discussion of IronPython
Subject: Re: [IronPython] clrtype: How to subclass ClrClass?

On 06/02/2010 11:19, Lukas Cenovsky wrote:
 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.

Hehe, I ran into this a couple of days ago on Silverlight as well.

All the best,

Michael


 -- 
 -- Lukáš


 ___
 Users mailing list
 Users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.


___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com