Thanks for the bug report Kurt.  I've opened CodePlex bug #2599 to track the 
issue 
(http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=2599
 )

We currently don't allow assignment to __builtins__ - this is a known 
incompatibility that we'll document for the time being and fix in the future.  
The from list is just a simple bug that we should fix - I've tentatively opened 
this as a 1.01 bug.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kurt Blackwell
Sent: Sunday, August 20, 2006 12:03 AM
To: [email protected]
Subject: [IronPython] __import__ bugs?

I'm quite new to Python in general, but one of the first things I wanted to try 
was to get IronPython to load scripts out of my own virtual directory system.  
__import__ seemed like a good place to start, but IronPython seems to be doing 
things differently from CPython.

CPython expects you to overwrite __import__ in __builtins__, but that is read 
only in IronPython.  As far as I can tell, IronPython will only use your 
__import__ if it's a global.

The other thing is that the fromlist doesn't get what I would expect.
Given the following:

def __import__(name, globals, locals, fromlist):
     print fromlist
from a import b

CPython will print "('b',)", but IronPython will print "[None]".  I'm guessing 
that's a bug.



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

Reply via email to