Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 37.

2024-02-29 Thread Collin Funk
On 2/29/24 6:58 PM, Collin Funk wrote: > The second fixes a problem I noticed when using the Emacs merge-gnulib > script. I noticed that most of the Automake conditionals for header > files weren't being converted to GNU Make syntax. The diff would have > many lines like this: I forgot to add the

[PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 37.

2024-02-29 Thread Collin Funk
Two more patches. The first is just a simple version bump to Automake version 1.11. The second fixes a problem I noticed when using the Emacs merge-gnulib script. I noticed that most of the Automake conditionals for header files weren't being converted to GNU Make syntax. The diff would have many

[PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 36.

2024-02-29 Thread Collin Funk
Follow gnulib-tool change 2017-03-14 Mathieu Lirzin gnulib-tool: don't automatically distribute files from top/ * pygnulib/GLModuleSystem.py (GLModule.getAutomakeSnippet_Unconditional): Don't distribute files from top/ automatically. --- A good way to test this: $ gnulib-tool --create-testdir

Re: Python type annotations

2024-02-29 Thread dima . pasechnik
On Thu, Feb 29, 2024 at 05:16:29PM +0100, Kévin Le Gouguec wrote: > (Hi! Apologies for the drive-by comments, hopefully they won't be > complete noise. Butting in hoping to clarify things at best, stand > corrected at worst) > > Bruno Haible writes: > > >> Python has added a lot of interesting

Re: Python type annotations

2024-02-29 Thread Collin Funk
On 2/29/24 8:16 AM, Kévin Le Gouguec wrote: > * the former provide some runtime sanity-checking, > * the latter are ineffective at runtime, and exist mainly for the > programmer's benefit (IDE hints for completion, documentation, > linting, etc). > > (Though linters like mypy do _also_ pick up

Re: Python type annotations

2024-02-29 Thread Collin Funk
On 2/29/24 7:10 AM, Bruno Haible wrote: > Argument tests like we have them: > >if type(actioncmd) is not str: > > are perfectly OK to use. Simple and straightforward. > > is_iterable feels a bit like fashion: You can use them if you want to be > fashonable and have extra money to spend :

Re: Python type annotations

2024-02-29 Thread Kévin Le Gouguec
(Hi! Apologies for the drive-by comments, hopefully they won't be complete noise. Butting in hoping to clarify things at best, stand corrected at worst) Bruno Haible writes: >> Python has added a lot of interesting type hinting stuff over the past >> few years [3]. > > Interesting. Feel free t

xalloc: Don't use identifier 'nonnull'

2024-02-29 Thread Bruno Haible
In some new code, I want the declaration of functions to clearly specify whether function arguments and return values can be NULL or not. Like in Java, where @NonNull and @NonNullable can be attached to a type. [1] GCC has a syntax for it, namely: extern simple_expression_t option_get_

Re: Python type annotations

2024-02-29 Thread Bruno Haible
Hi Collin, > Was gnulib-tool.py originally written in Python 2? Yes, it was written in Python 2, with the knowledge that Python 3 was already nearby around the corner. > I don't feel like I > don't see 'type(var) == list' anymore (in the very little Python code > I read). Usually I feel like you

Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 33.

2024-02-29 Thread Collin Funk
Hi Bruno, On 2/29/24 2:48 AM, Bruno Haible wrote: > One question: Why this change? > > -tests_modules = sorted(set(tests_modules)) > +tests_modules = sorted(list(set(tests_modules))) > > IMO, it is redundant, because sorted() of a set returns a list anyway. Ah, I had a feeling t

Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 34, 35

2024-02-29 Thread Bruno Haible
Collin Funk wrote: > Two more simple patches. The first deals with the @ALLOCA@ > substitution for libtests.a. The second just bumps the Autoconf > requirement to 2.64. Perfect. Thanks. Applied. Bruno

Re: [PATCH] gnulib-tool.py: Follow gnulib-tool changes, part 33.

2024-02-29 Thread Bruno Haible
Hi Collin, > This patch explains the random tests/ directory that gnulib-tool.py > makes with the Emacs script. I've tried to make this patch match the > shell code. Thanks! Applied. > Also, I've noticed that some functions check if a type(var) == list. > To avoid problems I've returned an empty