Xavier de Gaye added the comment: Note that using the module code object to find duplicates does not allow for selecting among the different code types: function, nested function, method or class.
Duplicates are extensively used within the std lib: Running find_duplicate_test_names.py, the initial script from issue 16056, on the whole std lib instead of just Lib/test, after updating the script to list all the duplicates (except <lambda>, <genexp>, ...) with: if not name[-1].startswith('<'): yield '.'.join(name) prints 347 (on a total of 1368 std lib .py files) duplicate functions, methods or classes. To eliminate module level functions (but not nested functions), the script is run now with the following change: if len(name) > 2 and not name[-1].startswith('<'): yield '.'.join(name) and lists 188 duplicate nested functions, methods or classes. In this list there are 131 duplicates in .py files located in the subdirectory of a "test" directory. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16079> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com