Is this against beta 1 or the latest and greatest sources from CodePlex (or 
RubyForge :))?

If it's the latest and greatest the DLR has been split into 2 separate parts: 
Microsoft.Scripting.dll and Microsoft.Scripting.Core.dll.  SourceCodeKind is in 
the core so this works for me:

import clr
clr.AddReference('Microsoft.Scripting.Core')
from Microsoft.Scripting import SourceCodeKind

The reason for this change is that the DLR team is currently working through 
the layering of the DLR and figuring out what parts will end up in 
System.Core.dll for some future .NET release.  So for a while code will be 
moving between these 2 DLLs.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Eloff
Sent: Monday, April 21, 2008 7:03 AM
To: Discussion of IronPython
Subject: [IronPython] How do I import SourceCodeKind enumeration?

Using the source code for the DLR I've discovered that SourceCodeKind
lives in Microsoft.Scripting, (and is public) but...

>>> clr.AddReference('Microsoft.Scripting')
>>> from Microsoft.Scripting import SourceCodeKind
Traceback (most recent call last):
  File , line unknown, in Initialize##366
ImportError: Cannot import name SourceCodeKind

How do I import it? Can you import enumerations?

I need it for Engine.CreateScriptSourceFromString(str code, SourceCodeKind kind)

Thanks,
-Dan
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to