New submission from Andrew Stribblehill <[EMAIL PROTECTED]>: When I partially apply a function using functools.partial(), the resultant function doesn't have the same name as the original function (it has no __name__) and its docstring is that of functools.partial() rather than that of the function that was partially applied.
Transcript: Python 2.6 (r26:66714, Oct 13 2008, 10:32:02) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >> import functools >>> def sum(a,b,c): ... return a+b+c ... >>> functools.partial(sum,1) <functools.partial object at 0xf7efeb6c> >>> p = functools.partial(sum, 1) >>> p.__name__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'functools.partial' object has no attribute '__name__' >>> p(2,3) 6 >>> sum.__name__ 'sum' >>> sum.__doc__ >>> p.__doc__ 'partial(func, *args, **keywords) - new function with partial application\n\tof the given arguments and keywords.\n' ---------- components: Extension Modules messages: 74682 nosy: stribb severity: normal status: open title: functools.partial(), no __name__; wrong __doc__ type: behavior versions: Python 2.6 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4113> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com