[Ironpython-users] IronPython, Daily Digest 1/25/2014

CodePlex no_reply at codeplex.com
Sun Jan 26 09:21:47 CET 2014


Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] no public usable FunctionType.__new__

----------------------------------------------

ISSUES

1. [New issue] no public usable FunctionType.__new__
http://ironpython.codeplex.com/workitem/34932
User paweljasinski has proposed the issue:

"the only visible implementation of FunctionType.new raises NotImplementedException.
For small tweaks (e.g. faking module membership) it would be beneficial to have any usable FunctionType.new


example of use, out of ipython\interactive\utils.py
def interactive(f):
"""decorator for making functions appear as interactively defined.
This results in the function being linked to the user_ns as globals()
instead of the module globals().
"""
    # build new FunctionType, so it can have the right globals
    # interactive functions never have closures, that's kind of the point
    if isinstance(f, FunctionType):
        mainmod = __import__('__main__')
        f = FunctionType(f.__code__, mainmod.__dict__,
            f.__name__, f.__defaults__,
        )
    # associate with __main__ for uncanning
    f.__module__ = '__main__'
    return f

Our implementation in PythonFunctions:
        private PythonFunction(CodeContext context, FunctionCode code, PythonDictionary globals, string name, PythonTuple defaults, PythonTuple closure) {
            throw new NotImplementedException();
        }
"
----------------------------------------------



----------------------------------------------
You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20140126/a941e1df/attachment.html>


More information about the Ironpython-users mailing list