Hi all,

In our work to get Resolver One working on IronPython 2, we've noticed this
interesting behaviour and would like to know whether it's defined behaviour
that we can rely on or just happenstance.

Create a package with the following structure:
+ foo
|----__init__.py
|----foo.py

where foo.py contains
print "foo (compiled)"

and compile it to foo.dll.

Now change foo.py to
print "foo (not compiled)"

and add a bar package:
+ foo
|----__init__.py
|----foo.py
|---+ bar
    |--- __init__.py
    |--- bar.py

where bar contains:
print "bar (not compiled)"

then, the following code:
import clr
clr.AddReference('foo')
from foo import foo
from foo.bar import bar

outputs:
foo(compiled)
bar (not compiled)

and removing the AddReference line outputs:
foo (not compiled)
bar (not compiled)


This makes it clear that we can have a package that is split between
compiled dll and source and that they work together.

Can we rely on this behaviour? Is there a specified order in which imports
from different sources are resolved? How is the multiple identity of the foo
module (compiled and not compiled) handled?

Thanks

Glenn & Michael
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to