[Python.NET] CVS updates

Michael Amrhein Michael.Amrhein at t-online.de
Fri Nov 14 04:10:57 EST 2003


Brian Lloyd wrote:
...
>   - Fixed a dumb bug in constructor handling that could cause you 
>     to get an 'IntPtr.Zero' instance rather than an exception in 
>     some cases when instantiating an object (this was the root of 
>     Michael's Point subclassing problem)
...
Hi Brian,
the bug in constructor handling is fixed:
(running beta 2)
Python 2.3.2 (#49, Oct  2 2003, 20:02:00) [MSC v.1200 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import CLR
 >>> from CLR.System.Drawing import Point
 >>> class P(Point):
...     def __repr__(self):
...             return 'P(%s,%s)' % (self.X, self.Y)
...
 >>> p=P()
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: no constructor matches given arguments

But there is still some strange behavior:

 >>> p=P(0,0)
 >>> p.__repr__()
'P(0,0)'

Fine, but ...

 >>> repr(p)
'<CLR.P object at 0x008ED930>'

Why?

Michael




More information about the PythonDotNet mailing list