[IronPython] [python][IronPythonStudio] NamespaceClassesandAssembly Files

Pigneri, Rocco rpigneri at LavaStorm.com
Thu Jan 31 07:48:21 PST 2008


So, I actually ran the code outside of VS in two different ways:

1. I left VS compile it and then ran it on the command line manually.
This was the only way for me to get the "print" statements to work.
2. I ran the code from the IronPython console (using the winforms module
that is distributed with IPY itself).

In both cases, the results were the same.

Thank you,

Rocco 

-----Original Message-----
From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland
Sent: Wednesday, January 30, 2008 6:35 PM
To: Discussion of IronPython
Subject: Re: [IronPython] [python][IronPythonStudio]
NamespaceClassesandAssembly Files

Michael's probably at least partially correct about this.  The other,
evil, side of using CodeDom is that we might be using the "static type
compiler" which primarily exists for supporting ASP.NET.  There we're
not only using CodeDom but we're also required to generate a .NET type
that ASP.NET can instantiate - and that creates something which isn't
quite Python.

One interesting thing to try here is running the code outside of VS -
e.g. just ipy foo.py from the command line.  That will ensure you don't
get the static type compiler - unfortunately I'm not sure off the top of
my head if it'll get used or not in the WinForms scenario.

________________________________________
From: users-bounces at lists.ironpython.com
[users-bounces at lists.ironpython.com] On Behalf Of Michael Foord
[fuzzyman at voidspace.org.uk]
Sent: Wednesday, January 30, 2008 2:39 PM
To: Discussion of IronPython
Subject: Re: [IronPython] [python] [IronPythonStudio]
NamespaceClassesandAssembly Files

Pigneri, Rocco wrote:
> 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.
>
I strongly suspect it is the consequence of the CodeDOM provider that
produces similarly structured code whatever the target language. I'm
sure there *must* be some way to rectify this for IronPython though as
those namespace classes are worse than useless.

Michael

> Thank you,
>
> Rocco
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com
> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt 
> Hagenlocher
> Sent: Wednesday, January 30, 2008 2:13 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] [python] [IronPythonStudio] 
> NamespaceClassesandAssembly Files
>
> 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?
>>
>
> Exactly.
>
> 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 Hagenlocher
> curt at hagenlocher.org
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>

_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Users mailing list