Hi Bruno,

Thanks for your recent patch gnulib-tool.py. I didn't really look at it
until now.

One minor correction I applied. The GLModule.getDependentsRecursively
function returns 'set[GLModule]' not 'str'.

The function looks similar to a function I wrote that does this to the
set before returning:

        module_names = sorted([ module.name
                                for module in outmodules ])
        return lines_to_multiline(module_names)

So I assume it was just a simple copy past mistake.

Now that I think of it I'm not sure why I return a string there. I think
it is better to return a set and let the caller sort as they wish,
format for printing, etc. Perhaps I was just focused on getting it
working at the time. :)

Collin

>From 2f400ffc4026513216f0fc9f545c470e06f43986 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Fri, 2 Aug 2024 20:52:28 -0700
Subject: [PATCH] gnulib-tool.py: Correct type hint and doc string.

* pygnulib/GLModuleSystem.py (GLModule.getDependentsRecursively): Adjust
type hint and doc string to correctly state a set of GLModule's is
returned.
---
 ChangeLog                  | 7 +++++++
 pygnulib/GLModuleSystem.py | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2f1340a06a..d331b50f10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-08-02  Collin Funk  <collin.fu...@gmail.com>
+
+	gnulib-tool.py: Correct type hint and doc string.
+	* pygnulib/GLModuleSystem.py (GLModule.getDependentsRecursively): Adjust
+	type hint and doc string to correctly state a set of GLModule's is
+	returned.
+
 2024-08-02  Bruno Haible  <br...@clisp.org>
 
 	Allow use of --avoid=extensions-aix.
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index e713b60fc9..04bb87a46d 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -604,9 +604,9 @@ def getDependents(self) -> list[GLModule]:
             self.cache['dependents'] = result
         return self.cache['dependents']
 
-    def getDependentsRecursively(self) -> str:
+    def getDependentsRecursively(self) -> set[GLModule]:
         '''Return a list of recursive dependents of this module,
-        as a list of GLModule objects.'''
+        as a set of GLModule objects.'''
         handledmodules = set()
         inmodules = set()
         outmodules = set()
-- 
2.45.2

Reply via email to