Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no need to use == True/False #13

Open
actopozipc opened this issue Mar 21, 2024 · 0 comments
Open

There is no need to use == True/False #13

actopozipc opened this issue Mar 21, 2024 · 0 comments

Comments

@actopozipc
Copy link

Everytime you write something like
expression == True

, you could just write expression, because it is already an object of type bool. For example, kdelta.py in line 449:

if printing == True:

Instead, do

if printing:

On the contrary, python offers the not keyword, a boolean operator to invert a value. Instead of

if config.space_time == False and spatial is None:

in kdelta.py line 489, you can do

if not config.space_time and spatial is None:

I dont know or think that it makes a difference performance-wise, but it hurts my head if I have to read something like this in open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant