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.
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
https://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to