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

Redundant parentheses and comparison to None should be 'if cond is not None': #75

Closed
khan-asfi-reza opened this issue May 8, 2022 · 4 comments · Fixed by #79
Closed
Labels
enhancement New feature or request

Comments

@khan-asfi-reza
Copy link
Contributor

According to PEP 8 guidance, there must be no redundant parentheses for example

def foo():
  # return (2) # Bad
  return 2 # Good
if (value == 2): # Bad
   pass

if value == 2: # Good
  pass

Comparison conditions
According to PEP 8: E711 comparison to None should be if cond is not None

  if VLL != None: # Bad
      Vm = _np.sqrt(2 / 3) * VLL
  if VLL is not None: # Good
      Vm = _np.sqrt(2 / 3) * VLL
@khan-asfi-reza
Copy link
Contributor Author

I am working on this issue

@engineerjoe440
Copy link
Owner

Will there be any concern about Python version support with the change from "!=" to "is not"? So long as there won't be any issues, I think that will be fine! Thank you!

@khan-asfi-reza
Copy link
Contributor Author

It will not affect other versions of python. In fact it is supported in python2

@engineerjoe440
Copy link
Owner

Excellent! Then yeah! Let's do it! :)

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

Successfully merging a pull request may close this issue.

2 participants