The import statement is used for namespaces, which usually (but don't have to) 
match the assembly names. You reference the assembly once, and import whatever 
types/namespaces you need from it. Thinking of it in another way, referencing 
the assembly grants the ability to import from that assembly. But in itself it 
does nothing apparent from the perspective of the consuming script.

This is similar to how C#/VB work where you reference the assembly once for 
your project, and then you place using/import statements at the top of 
individual code files to bring the types contained within the assembly into 
scope.



Keith Rome
Senior Consultant and Architect
MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
Wintellect | 770.617.4016 | kr...@wintellect.com<mailto:r...@wintellect.com>
www.wintellect.com<http://www.wintellect.com/>

From: ironpython-users-bounces+rome=wintellect....@python.org 
[mailto:ironpython-users-bounces+rome=wintellect....@python.org] On Behalf Of 
Geoffrey Bantle
Sent: Saturday, February 18, 2012 6:07 PM
To: ironpython-users@python.org
Subject: [Ironpython-users] Dotted assembly names and import

Hello,

I have a question about assemblies compiled with pyc.py. If you just name
them normally like, "Foobar.dll" or "Snafu.dll" you can add a reference
to them and import them into IronPython as one would expect. If however
you name them like "Foobar.Snafu.dll" you can add a reference to them
but it does not seem like you can import them at all. You are given the error:

"ImportError: No module named Snafu"

Is this intended behavior? My understanding is that dotted assembly names
are quite common in .Net and I have a project where I would like to have
assemblies compiled by pyc.py to sit side by side with assemblies written
in C#. Maybe this is not the natural way to do things?

Any help is appreciated.

Best Regards,
Geoffrey Bantle
gban...@gmail.com<mailto:gban...@gmail.com>
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to