-
-
Notifications
You must be signed in to change notification settings - Fork 953
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
Small Pythonic code changes for datastructures.py file #1167
Conversation
.gitignore
Outdated
@@ -11,3 +11,6 @@ venv*/ | |||
.python-version | |||
build/ | |||
dist/ | |||
.idea/ |
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried: encode/uvicorn#1001
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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/ |
There was a problem hiding this comment.
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? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) done
There was a problem hiding this 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?
starlette/datastructures.py
Outdated
for idx, (item_key, item_value) in enumerate(self._list): | ||
if item_key == set_key: | ||
found_indexes.append(idx) | ||
found_indexes = [ |
There was a problem hiding this comment.
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.
starlette/datastructures.py
Outdated
for idx, (item_key, item_value) in enumerate(self._list): | ||
if item_key == del_key: | ||
pop_indexes.append(idx) | ||
pop_indexes = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this 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 awesome merge :D |
The aim is to simplify and add more style :)
Thanks.