Message171536
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. |
|
Date |
User |
Action |
Args |
2012-09-28 19:52:51 | xdegaye | set | recipients:
+ xdegaye, ezio.melotti, eric.araujo, chris.jerdonek |
2012-09-28 19:52:51 | xdegaye | set | messageid: <1348861971.78.0.858785482034.issue16079@psf.upfronthosting.co.za> |
2012-09-28 19:52:51 | xdegaye | link | issue16079 messages |
2012-09-28 19:52:51 | xdegaye | create | |
|