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

Codebase Refactor #960

Open
HighnessAtharva opened this issue Apr 8, 2023 · 3 comments
Open

Codebase Refactor #960

HighnessAtharva opened this issue Apr 8, 2023 · 3 comments

Comments

@HighnessAtharva
Copy link

After glancing over the codebase, I came across code blocks that could be refactored to make them more maintainable and easier to read. Also, some refactors can make the code more "Pythonic". and performant. I have a few ideas in mind and most of them are:-

  • using if expressions than if conditions
  • list comprehensions instead of a for loop for smaller logical blocks.
  • Usage of f-strings ( I saw that the env supports 3.4 but f-strings have been added from Python 3.6). So should I refactor this?
  • Simplifying if/else code blocks to be more concise.
  • Merge nested conditional clauses.

Please let me know what Python version should be supported for these refactors and I'll get to work on it.
image

@HighnessAtharva
Copy link
Author

If possible, I think we should lift minimum Python version requirement to 3.6/3.7 since we can really improve the readability and efficiency of the code.

@stephanebruckert
Copy link
Member

I think these are all great suggestions for #652

v3 has its own branch. I would recommend that you use https://github.com/spotipy-dev/spotipy/tree/v3 and open a PR against it.

About the python support, it should be fair to only support >= 3.8 as 3.7 security support ends in June 2023 https://endoflife.date/python, so feel free to use f-strings.

Thanks for any contribution!

PS: that v3 branch is a bit out of sync with the main branch, as it needs a rebase which I have in progress. Just to let you know that conflicts may arise, but we will have all the time to fix them.

@HighnessAtharva
Copy link
Author

Glad to heart that. I'll start working and make a PR on the v3 branch soon!

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

No branches or pull requests

2 participants