[IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files
rpigneri at LavaStorm.com
Wed Jan 30 13:40:58 PST 2008
Ah. In that case, I would strongly urge that the namespace class
functionality of IPS be removed so that developers don't have to keep
tip-toeing around that issue. Unless there is another way of using
classes in Python that I'm not aware of.
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt
Sent: Wednesday, January 30, 2008 2:13 PM
To: Discussion of IronPython
Subject: Re: [IronPython] [python] [IronPythonStudio]
On Jan 30, 2008 10:29 AM, Pigneri, Rocco <rpigneri at lavastorm.com> wrote:
> It sounds like instead, I need to do this:
> import FormOne
> import FormTwo
> f = FormOne.Forms.FormOne()
> f2 = FormTWo.Forms.FormTwo()
> Is this correct?
When you said "from FormOne import *", you introduced the symbol "Forms"
into the current namespace with the value of "FormOne.Forms".
When you then said "from FormTwo import *", you replaced the symbol
"Forms" with the value of "FormTwo.Forms".
As you suggest, Python's "import" statement is not like the C# "using"
statement. A Pythonic import will introduce new symbols into the local
namespace at run time. The C# using statement is simply a directive to
the compiler to tell it which namespaces to search in for symbols that
are otherwise undefined in the local scope. It literally does not emit
any IL code that is executed at runtime.
curt at hagenlocher.org
Users mailing list
Users at lists.ironpython.com
More information about the Users