Hello all,
A bug in IronPython 1.1. This one has bitten us and it would be very
nice to have it fixed.
Create a .NET array in one module and then use it in another module that
hasn't imported clr (or System) and it will be stripped of its .NET
methods and properties.
Importing clr fixes the problem, but shouldn't be necessary (right?).
To see this, create a module called 'createArray.py':
from System import Array
def CreateArray():
return Array.CreateInstance(int, 2, 2)
Then use the module from another IronPython program. E.g. :
from createArray import CreateArray
array = CreateArray()
print array.Rank
This results in the following error:
C:\>ipy testArray.py
Traceback (most recent call last):
File C:\testArray.py, line 4, in Initialize
AttributeError: 'Array[int]' object has no attribute 'Rank'
If you add an import clr to the program then it does the right thing...
Michael Foord
http://www.ironpython.info
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com