[IronPython] dll

Garth T Kidd garth at deadlybloodyserious.com
Sat Sep 11 09:48:17 CEST 2004

Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on
Type "help", "copyright", "credits" or "license" for more information.
>>> def foo(a, b):
...   return "%s: %d" % (a, b)
>>> foo.__CLRDetails__ = (str, int)
>>> dir(foo)
['__CLRDetails__', '__call__', '__class__', '__delattr__', '__dict__',
, '__get__', '__getattribute__', '__hash__', '__init__', '__module__',
', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__',
', 'func_closure', 'func_code', 'func_defaults', 'func_dict', 'func_doc',
globals', 'func_name']

I'd hope that IronPython waits until it has finished executing the model
before generating the assembly. That's how Python does it. If you want to
define a class and then 'del' it. See also: method = classmethod(method).
You have to wait until the dust settles before you know what you're trying
to publish. 

IronPython functions not having arbitrary slots is a bug. 

Anyone managed to make UnitTest work? Or, some suitable subset until we can
get the real deal working? 

-----Original Message-----
From: Curt Hagenlocher [mailto:curt at hagenlocher.org] 
Sent: Saturday, 11 September 2004 10:41 AM
To: Garth T Kidd; users-ironpython.com at lists.ironpython.com
Subject: RE: [IronPython] dll

"Garth T Kidd" <garth at deadlybloodyserious.com> writes:

> 	import System
> 	def foo(a, b):
> 		return "%s: %d" % (a, b)
> 	my_func.__CLRdetails__ = (System.String, System.Int64,
> System.String)

Does this syntax work in Python 2.3?  It doesn't currently work in
IronPython (hereafter, "FePy"), because the function object doesn't allow
assignment to arbitrary slots.

The question is, at what point does FePy actually emit the foo function into
the assembly?  Is it just the assignment to the magic member?  That seems
problematic.  Maybe you should have to call a function like

Other interop issues:
What class will global functions be a member of?
How will the namespace of the assembly be controlled?
Does it make sense that 1 FePy source file = 1 assembly, or should there be
a way to combine them?

Curt Hagenlocher
curt at hagenlocher.org

More information about the Ironpython-users mailing list