Xiang Zhang added the comment:

Hi, I've written a patch to accomplish this in Py3.6.

This patch is much cleaner but has one drawback, when used as decorator 
factory, you have to specify name as a keyword argument. But considering the 
codes that have to been imported to check arguments, I think it's not bad. (I 
don't want to check `function` is a string or not.)

Also one side effect that I can not eliminate is when it is used as a normal 
function, the function instead of None is returned. I see the former patches 
get this problem too.

Hope to get feedback.

----------
Added file: http://bugs.python.org/file43401/issue7769.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7769>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to