William has continued to make good progress on Ironclad. He's just written an import hook (not sure if it is checked in yet, probably not) - this really does allow you to just import C extensions from IronPython:

C:\dev\ironclad>ipy
IronPython 2.0 Beta (2.0.0.2000) on .NET 2.0.50727.312
Copyright (c) Microsoft Corporation. All rights reserved.
>>> import importhook
>>> import bz2
>>> bz2.BZ2File.__doc__
"BZ2File(name [, mode='r', buffering=0, compresslevel=9]) -> file object\n\nOpen a bz2 file. The mode can be 'r' or 'w', for reading (default) or\nwriting. When opened for writing, the file will be created if it doesn't\nexist, and truncate d otherwise. If the buffering argument is given, 0 means\nunbuffered, and larger numbers specify the buffer size. If compresslevel\nis given, must be a number b etween 1 and 9.\n\nAdd a 'U' to mode to open the file for input with universal n ewline\nsupport. Any line ending in the input file will be seen as a '\\n' in\nP ython. Also, a file so opened gains the attribute 'newlines'; the value\nfor thi s attribute is one of None (no newline read yet), '\\r', '\\n',\n'\\r\\n' or a t uple containing all the newline types seen. Universal\nnewlines are available on
ly when reading.\n"
>>>

It only works for C extensions that don't use parts of the C Python API that aren't supported by Ironclad yet... But still. :-)

Michael Foord
http://www.ironpythoninaction.com/
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to