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

Refactoring Python code - Improve Readability and maintainability #114

Open
pratik-choudhari opened this issue Mar 28, 2024 · 1 comment

Comments

@pratik-choudhari
Copy link

Who is the issue affecting?

Contributors and Maintainers

What is affected by this issue?

Readability, maintainability, debugging and code reviews

Comments

Hi @pradeeban, I was trying to read the code and figure out its workings. I had a hard time understanding the core Python modules.
Common issues noticed:

  • type hinting
  • function docstrings
  • error handling
  • complicated equality expressions
  • string formatting

Sample Solution

The concore.write function can be refactored as follows (original on the left, modified in the right):
image

Scope

Throughout the project

@pratik-choudhari
Copy link
Author

Additionally, If docstring, type hints and return types are added to functions, IDEs such as PyCharm can use this information and warn a developer if the parameters do not match with the type hints

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