[IronPython] Some Objects not visible in my Shell?

Douglas Blank dblank at brynmawr.edu
Thu May 7 05:51:02 CEST 2009


I'm working on a couple of variations of an IronPython Shell, and I have
the following issue. When I import some DLLs interactively, I'm not seeing
all of the available objects. For example, in my shells I try:

>>> import clr
>>> clr.AddReference("System")
>>> from System.Threading import Thread

and I get the error that 'Cannot import name Thread'. In fact, if I:

>>> import System.Threading
>>> dir(System.Threading)

I get:

['Semaphore', 'SemaphoreFullException', 'ThreadExceptionEventArgs',
'ThreadExceptionEventHandler']

However, using the ipy.exe console, I correctly get:

>>> import System.Threading
>>> dir(System.Threading)
['AbandonedMutexException', 'ApartmentState', 'AsyncFlowControl',
'AutoResetEvent', 'CompressedStack', 'ContextCallback', 'EventResetMode',
'EventWaitHandle', 'ExecutionContext', 'HostExecutionContext',
'HostExecutionContextManager', 'IOCompletionCallback', 'Interlocked',
'LockCookie', 'ManualResetEvent', 'Monitor', 'Mutex', 'NativeOverlapped',
'Overlapped', 'ParameterizedThreadStart', 'ReaderWriterLock',
'RegisteredWaitHandle', 'Semaphore', 'SemaphoreFullException', 'SendOrP
ostCallback', 'SynchronizationContext', 'SynchronizationLockException',
'Thread', 'ThreadAbortException', 'ThreadExceptionEventArgs',
'ThreadExceptionEventHandler', 'ThreadInterruptedException', 'ThreadPool',
'ThreadPriority', 'ThreadStart', 'ThreadStartException', 'ThreadState',
'ThreadStateException', 'Timeout', 'Timer', 'TimerCallback',
'WaitCallback', 'WaitHandle', 'WaitHandleCannotBeOpenedException',
'WaitOrTimerCallback']

I feel I must be doing something fundamentally wrong... anyone have a
guess as to what that might be? Thanks for any ideas!

-Doug




More information about the Ironpython-users mailing list