[IronPython] How to call a specific base class constructor?
dinov at exchange.microsoft.com
Fri Sep 22 22:02:14 CEST 2006
The constructor is actually __new__, __init__ is merely an initializer which runs after constructor - which has no real analog in the .NET world. Therefore you'll want to override __new__ and pass in the values to the base __new__ that you want to use to construct the object with.
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ruxo Zheng
Sent: Wednesday, September 20, 2006 12:39 PM
To: users at lists.ironpython.com
Subject: [IronPython] How to call a specific base class constructor?
I'm customizing .NET ArrayList class like this:
from System.Collections import ArrayList
test = MyArrayList()
test.Capacity // return 0
It seems like default constructor is always called. Did I incorrectly call the base class' constructor?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users