Thanks for the report Seo, I'll fix this for a future release (I don't think 
it'll make it in time for the next one).  The problem here is that we're not 
currently using DynamicSite's for the setattr built-in function.  Instead we go 
to a runtime call in PythonOps which is going to attempt to do this via 
interfaces and DynamicType's.  That's actually not the correct way to set 
attributes anymore as it doesn't work x-lang (or w/ the member access operators 
that are defined on ScriptModule).  Luckily get/delete were switched over a 
while ago so those just work.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Friday, November 02, 2007 7:57 AM
To: Discussion of IronPython
Subject: [IronPython] setattr and module

# x.py
# empty

# test.py
import x
setattr(x, 'a', 1)
print x.a

AttributeError: 'module' object has no attribute 'a'

--
Seo Sanghyeon
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to