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

Small Pythonic code changes for datastructures.py file #1167

Merged
merged 6 commits into from
Jun 11, 2021

Conversation

ShahriyarR
Copy link
Contributor

The aim is to simplify and add more style :)
Thanks.

.gitignore Outdated
@@ -11,3 +11,6 @@ venv*/
.python-version
build/
dist/
.idea/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those ignores are not going to be accepted 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@ShahriyarR ShahriyarR Apr 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahahaha :D Okay reverting back)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

.gitignore Outdated
@@ -10,4 +10,4 @@ site/
venv*/
.python-version
build/
dist/
dist/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the new line at the end? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) done

Copy link
Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ShahriyarR Thanks for the PR! 🎉

The two first changes I think it does improve readability. But I don't feel the same for the last two. Can you check my comments?

for idx, (item_key, item_value) in enumerate(self._list):
if item_key == set_key:
found_indexes.append(idx)
found_indexes = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is controversial. Not everybody believes it's an improvement. I'd prefer to not change it.

for idx, (item_key, item_value) in enumerate(self._list):
if item_key == del_key:
pop_indexes.append(idx)
pop_indexes = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @ShahriyarR ! 🎉

:)

@Kludex Kludex merged commit f7aa776 into encode:master Jun 11, 2021
@ShahriyarR
Copy link
Contributor Author

@Kludex awesome merge :D

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

Successfully merging this pull request may close these issues.

4 participants