RE: [IronPython] Implementing an interface

2005-05-22 Thread Jim Hugunin
Neil Hodgson wrote:
>I have an interface defined in C# that I would like to implement in
> IronPython 0.7.5. Similar code works in Jython. The interface looks

Implementing an interface in Python is one of the best ways to
interoperate with a strongly typed language.  As you noted, this works
very well in Jython.  Unfortunately, this isn't implemented yet in
IronPython 0.7.5.  This is a very high priority and it should be
available in the next couple of weeks.

Thanks - Jim
___
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


RE: [IronPython] getting at the global __dict__ from a module?

2005-05-22 Thread Jim Hugunin
The dictionary you get back from globals() is the __dict__ from the current 
module.  __dict__ is a special field which holds the dictionary which holds all 
of the rest of the data on a module.

Another good way to get this dictionary is for the module to import itself and 
then look up the __dict__ member of itself.  As I was testing this, I learned 
that this won't work in IronPython 0.7.5.  That's another bug we need to fix.  
In theory, and in CPython, you should be able to do this.  We'll make this work 
very soon.
-- foo.py --
import sys
dict = sys.modules[__name__].__dict__


Thanks - Jim


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sumit Basu
Sent: Saturday, May 21, 2005 7:30 PM
To: users-ironpython.com@lists.ironpython.com
Subject: [IronPython] getting at the global __dict__ from a module?

Does anyone know how to get at the global __dict__ from inside a module 
(without passing it in as an argument, of course)?   __dict__ is special in 
some way: when you do a dir() at toplevel you don't see it; looking at 
globals() gives you the same info.  Am I missing something?
 
-Sumit
___
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] (no subject)

2005-05-22 Thread Jon Cosby
Is there something preventing me from importing from the standard Python
library in IronPython 0.6? I can import my own modules, but get a
"NotImplementedException" when importing from the standard library.


Jon Cosby

>>> import sys
>>> sys.path
['F:\\Projects\\IronPython\\bin', 'C:\\Python23\\Lib',
'F:\\Projects\\IronPython\\bin\\Projects']
>>> import myscript
>>> import os
System.NotImplementedException: EmitDel: IronPython.AST.NameExpr
   at IronPython.AST.Expr.EmitDel(CodeGen cg) in
f:\Projects\IronPython\IronPython\AST\Expr.cs:line 42
   at IronPython.AST.DelStmt.Emit(CodeGen cg) in
f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 681
   at IronPython.AST.SuiteStmt.Emit(CodeGen cg) in
f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 65
   at IronPython.AST.IfStmt.Emit(CodeGen cg) in
f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 117
   at IronPython.AST.SuiteStmt.Emit(CodeGen cg) in
f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 65
   at IronPython.AST.ModuleDef.Generate(String sourceFileName) in
f:\Projects\IronPython\IronPython\AST\ModuleDef.cs:line 71
   at IronPython.Objects.Importer.LoadFromSource(String fullName, String
filename, List __path__) in
f:\Projects\IronPython\IronPython\Objects\module.cs:line 260
   at IronPython.Objects.Importer.LoadFromPath(String name, String
fullName, List path) in
f:\Projects\IronPython\IronPython\Objects\module.cs:line 246
   at IronPython.Objects.Importer.LoadTop(String name) in
f:\Projects\IronPython\IronPython\Objects\module.cs:line 210
   at IronPython.Objects.Importer.ImportOne(String fullName, Boolean
keepTop) in f:\Projects\IronPython\IronPython\Objects\module.cs:line
193
   at IronPython.Objects.module.Import(String fullName, Boolean keepTop)
in f:\Projects\IronPython\IronPython\Objects\module.cs:line 98
   at IronPython.Objects.Ops.Import(module mod, String fullName) in
f:\Projects\IronPython\IronPython\Objects\Ops.cs:line 1562
   at input_3.Run(Frame frame)
   at IronPythonConsole.IronPython.DoInteractive() in
f:\Projects\IronPython\IronPythonConsole\IronPython.cs:line 193


___
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


RE: [IronPython] (no subject)

2005-05-22 Thread Martin Maly
This is a bug that has been fixed in one of the 0.7.* releases. You can
get newest version (0.7.5) of IronPython from
http://workspaces.gotdotnet.com/ironpython

Martin

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Jon Cosby
> Sent: Sunday, May 22, 2005 11:38 AM
> To: users-ironpython.com@lists.ironpython.com
> Subject: [IronPython] (no subject)
> 
> Is there something preventing me from importing from the 
> standard Python library in IronPython 0.6? I can import my 
> own modules, but get a "NotImplementedException" when 
> importing from the standard library.
> 
> 
> Jon Cosby
> 
> >>> import sys
> >>> sys.path
> ['F:\\Projects\\IronPython\\bin', 'C:\\Python23\\Lib', 
> 'F:\\Projects\\IronPython\\bin\\Projects']
> >>> import myscript
> >>> import os
> System.NotImplementedException: EmitDel: IronPython.AST.NameExpr
>at IronPython.AST.Expr.EmitDel(CodeGen cg) in 
> f:\Projects\IronPython\IronPython\AST\Expr.cs:line 42
>at IronPython.AST.DelStmt.Emit(CodeGen cg) in 
> f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 681
>at IronPython.AST.SuiteStmt.Emit(CodeGen cg) in 
> f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 65
>at IronPython.AST.IfStmt.Emit(CodeGen cg) in 
> f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 117
>at IronPython.AST.SuiteStmt.Emit(CodeGen cg) in 
> f:\Projects\IronPython\IronPython\AST\Stmt.cs:line 65
>at IronPython.AST.ModuleDef.Generate(String 
> sourceFileName) in 
> f:\Projects\IronPython\IronPython\AST\ModuleDef.cs:line 71
>at IronPython.Objects.Importer.LoadFromSource(String 
> fullName, String filename, List __path__) in 
> f:\Projects\IronPython\IronPython\Objects\module.cs:line 260
>at IronPython.Objects.Importer.LoadFromPath(String name, 
> String fullName, List path) in 
> f:\Projects\IronPython\IronPython\Objects\module.cs:line 246
>at IronPython.Objects.Importer.LoadTop(String name) in 
> f:\Projects\IronPython\IronPython\Objects\module.cs:line 210
>at IronPython.Objects.Importer.ImportOne(String fullName, Boolean
> keepTop) in f:\Projects\IronPython\IronPython\Objects\module.cs:line
> 193
>at IronPython.Objects.module.Import(String fullName, 
> Boolean keepTop) in 
> f:\Projects\IronPython\IronPython\Objects\module.cs:line 98
>at IronPython.Objects.Ops.Import(module mod, String 
> fullName) in 
> f:\Projects\IronPython\IronPython\Objects\Ops.cs:line 1562
>at input_3.Run(Frame frame)
>at IronPythonConsole.IronPython.DoInteractive() in 
> f:\Projects\IronPython\IronPythonConsole\IronPython.cs:line 193
> 
> 
> ___
> users-ironpython.com mailing list
> users-ironpython.com@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> 
___
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com