On 4/27/24 3:22 PM, Bruno Haible wrote: > Thanks. There's a nit, though: These lines do not remove duplicates. > > module_set = set(modules) > modules = [ module > for module in modules > if module in module_set ]
Oops... Today isn't my day I guess. I think the least annoying way to remove duplicates while preserving order is this trick I mentioned a few months ago: print(list(dict.fromkeys([5, 1, 3, 100, 3, 3, 5, 5, 5]))) [5, 1, 3, 100] This works since we require Python 3.7 [1]: Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6. There is also collections.OrderedDict for previous versions though. > I confirm, it passes for me as well now. > > But I'm confused: I thought part of the problem was that a libtests was being > generated. Putting the modules in a different order makes the libtests > disappear?? What is going on? Likewise. The sorting of gnulib-tool.py was still incorrect, so that commit was needed minus my silly set mistake. Sounds like it is time for me to learn how the Python debuggers work and step through it. :) [1] https://docs.python.org/3/library/stdtypes.html#mapping-types-dict Collin