bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool.py: Add type hints to classes.


From: Bruno Haible
Subject: Re: gnulib-tool.py: Add type hints to classes.
Date: Mon, 29 Apr 2024 22:16:24 +0200

Hi Collin,

> This patch adds type hints to the Python classes.

Looks good. Thanks!

> Same as previously done in GLFileTable that I wrote. The only new
> thing introduced is the syntax for class variables, so this line in a
> class definition:
> 
>      section_label_pattern = re.compile(...)
> 
> becomes this:
> 
>      section_label_pattern: ClassVar[re.Pattern] = re.compile(...)

It's pretty self-explaining, therefore OK to use this new ClassVar[...].

Bruno






reply via email to

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