bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to solve this diff between gnulib-tool and gnulib-tool.py?


From: Collin Funk
Subject: Re: Best way to solve this diff between gnulib-tool and gnulib-tool.py?
Date: Sat, 2 Mar 2024 05:33:31 -0800
User-agent: Mozilla Thunderbird

Hi Bruno,

On 3/2/24 2:18 AM, Bruno Haible wrote:
> The output needs to be deterministic; the natural order from the module
> description is perfectly fine. Therefore the sorting in the Python code should
> go away.

I've attached a patch if you haven't changed it yet.

> is not only to sort, but also to remove duplicates. But this is not needed 
> either.

I didn't see any sorting or removal of duplicates in
func_filter_filelist so I assumed sorted() and set() would be wrong.
Thanks for the extra testing and explanations.

Since sets are unordered, before I found out duplicates weren't
removed, I was wondering what the fastest way to remove duplicates
from a list in Python would be while preserving order. Turns out an
implementation detail in Python 3.7+ allows for this to be done
quickly in one line. Might be come in handy later.

[1] https://stackoverflow.com/a/17016257

Collin

Attachment: 0001-gnulib-tool.py-Make-output-of-test-Makefile.am-match.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]