[IronPython] [python] [IronPythonStudio] Namespace Classes andAssembly Files

Curt Hagenlocher curt at hagenlocher.org
Wed Jan 30 18:44:42 CET 2008


On Jan 30, 2008 9:25 AM, Pigneri, Rocco <rpigneri at lavastorm.com> wrote:
> Ah, ha!  I think I may have found the culprit!
>
> If I have the following import sequences in the follwing order, then
> only FormTwo is available:
>
> from FormOne import *
> from FormTwo import *
>
> However, if they are in this order, then only FormOne is available:
>
> from FormTwo import *
> from FormOne import *
>
> It seems that only the last class statement that is evaluated/imported
> is retained.

Are you importing FormOne from FormTwo and/or vice versa?

Pythonic namespace collisions are far less likely if you keep things
in their namespaces.  This is another way of saying that "from X
import *" is potentially evil and should be used very carefully.  Try
saying "import FormOne" and then qualify the class as
"FormOne.FormOne".

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Ironpython-users mailing list