[IronPython] How to set a namespace for IronPython classes?

Michael Foord fuzzyman at voidspace.org.uk
Fri Oct 17 14:26:16 CEST 2008


Vladimir Eremeev wrote:
> Hi all.
> I am very new to the IronPython and to .NET
>
> I have installed IronPython v2.0 beta 5  and the IronPythonStudio,
> integrated in MS VisualStudio 2008.
>
> I have created a simple IronPython project containing one form and compiled
> it to the class library.
> However, when I have opened the resulting DLL in the Studio's Object
> Browser, I have seen that classes are in the global namespace, while other
> system classes are in their own namespaces.
>
> How do I create a namespace and put my classes to it?
>
>
>   

Hello Vladimir,

Python as a language uses modules and packages to do namespacing rather 
than .NET namespaces. This means that introspecting assemblies compiled 
from Python code to examine their *structure* is not really useful.

If you want to *use* those classes from .NET (say from C#) you will need 
to do it through the IronPython hosting API rather than directly 
referencing the compiled assemblies anyway.

What are you actually trying to achieve?

Michael

-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://www.theotherdelia.co.uk/




More information about the Ironpython-users mailing list