New submission from Xiang Zhang: In reprlib.recursive_repr, it seems __qualname__ is forgotten. Giving the example in reprlib document, it gives a strange result 'recursive_repr.<locals>.decorating_function.<locals>.wrapper' of Mylist.__repr__.__qualname__.
I simply add the assignment of __qualname__. But I doubt the treatment of __module__, __doc__, __name__, __qualname__ will raise AttributeError when they don't exist in user_function. Is this the desired behaviour or we'd better treat them like functools.update_wrapper, catch and then ignore the error. ---------- components: Library (Lib) files: qualname_of_recursive_repr_in_reprlib.patch keywords: patch messages: 262326 nosy: xiang.zhang priority: normal severity: normal status: open title: recursive_repr forgets to override __qualname__ of wrapper type: behavior versions: Python 3.6 Added file: http://bugs.python.org/file42266/qualname_of_recursive_repr_in_reprlib.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26634> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com