-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
MAINT: Cleaned up mintypecode for Py3 #14967
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
Conversation
385c852
to
a5cd4a1
Compare
Thanks, looks good at first sight. Could you remove the release note again? I think it is unnecessary here. |
a5cd4a1
to
0b83bf9
Compare
@seberg Done |
Using generators instead of full-blown lists Using set for search instead of list Using min to get single element insteaf of sorting full list
l = [(_typecodes_by_elsize.index(t), t) for t in intersection] | ||
l.sort() | ||
return l[0][1] | ||
return min((_typecodes_by_elsize.index(t), t) for t in intersection)[1] |
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.
Better as:
return min(intersection, key=_typecodes_by_elsize.index)
@eric-wieser well seen. I've updated the branch. @seberg I don't know how it works when I change the branch after a merge. |
This reverts commit 2fb8540.
You would have to create a new PR for followups. |
You can create a new PR from the same branch |
This is a small cleanup PR for
mintypecode
.All changes are internal, and should be relatively uncontroversial. As such no tests were modified in this PR.