Hi Bruno,

On 3/16/24 6:22 AM, Bruno Haible wrote:
> I don't see the point of writing bool() where 99.9% of the Python developers
> write False.
>   = bool()    seen 62 times [1]
>   = False     seen 358336 times [2]

Yes, I noticed this in a few places and changed it silently because it
is confusing.

Since you just fixed that, it seems like a good time to fix this line
which has annoyed me more than it should. It makes 'not condition'
look like it is a function call.

diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index 9ad4715d8b..cbe2534c72 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -314,7 +314,7 @@ class GLModule(object):
         '''GLModule.isTests() -> bool
 
         Check whether module is not a -tests version of module.'''
-        result = not(self.isTests())
+        result = not self.isTests()
         return result

Collin
From efe6d445b71ae8aa998dbac0eb6fda61756178f2 Mon Sep 17 00:00:00 2001
From: Collin Funk <[email protected]>
Date: Sat, 16 Mar 2024 07:20:39 -0700
Subject: [PATCH] gnulib-tool.py: Coding style: Avoid not().

* pygnulib/GLModuleSystem.py (isNonTests): Avoid not(). Write
'not condition' instead of 'not(condition)'.
---
 ChangeLog                  | 6 ++++++
 pygnulib/GLModuleSystem.py | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 64ea4b63e7..44ff5a5475 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-03-16  Collin Funk  <[email protected]>
+
+	gnulib-tool.py: Coding style: Avoid not().
+	* pygnulib/GLModuleSystem.py (isNonTests): Avoid not(). Write
+	'not condition' instead of 'not(condition)'.
+
 2024-03-16  Bruno Haible  <[email protected]>
 
 	gnulib-tool.py: Coding style: Avoid bool().
diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index 9ad4715d8b..cbe2534c72 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -314,7 +314,7 @@ class GLModule(object):
         '''GLModule.isTests() -> bool
 
         Check whether module is not a -tests version of module.'''
-        result = not(self.isTests())
+        result = not self.isTests()
         return result
 
     def getTestsName(self):
-- 
2.44.0

Reply via email to