I'm using IronPython 2.7
within PyDev 4.0.0.2x
in Eclipse Luna Service Release 2 (4.4.2). The editor's Autocompletion can 'see' the IsNullOrEmpty
method in System.String
library, but the Console cannot (opened against IronPython OR the current Script in the editor). It's not just autocompletion at that point, it throws an exception when I do this in the console:
import clr
import System
System.String.IsNullOrEmpty("")
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'type' object has no attribute 'IsNullOrEmpty'
I have no troubles in an ipy.exe terminal outside of Eclipse/PyDev. Following the help file, I checked the dump from eclipse\plugins\org.python.pydev_4.0.0.201504132356\pysrc>ipy.exe interpreterInfo.py
. Interestingly, all the .NET
libraries are missing from the forced_lib
section of the output, though they are there by default in my configured ironpython interpreter. I'm not sure if this is related.
UDPATE: I added System.String to the forced builtins of the IronPython interpreter configured for PyDev, updated and restarted the Workspace == No difference. I can call 'import System.String' without issues, but when I call 'from System.String import *, I get an interesting error of "ImportError: no module named str". I proceeded to create a System.String via: 'v = System.String("v")'. When I called dir(v), I only see python functions for python strings - nothing for .NET strings. I did not have this issue in PVTS for VS2013