bug-gnulib
[Top][All Lists]
Advanced

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

Re: gnulib-tool.py: Coding style: Avoid bool()


From: Collin Funk
Subject: Re: gnulib-tool.py: Coding style: Avoid bool()
Date: Sat, 16 Mar 2024 07:23:29 -0700
User-agent: Mozilla Thunderbird

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

Attachment: 0001-gnulib-tool.py-Coding-style-Avoid-not.patch
Description: Text Data


reply via email to

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