[IronPython] How do I import SourceCodeKind enumeration?

Dino Viehland dinov at exchange.microsoft.com
Mon Apr 21 18:29:35 CEST 2008

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
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: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] 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)

Users mailing list
Users at lists.ironpython.com

More information about the Ironpython-users mailing list