Merged
Conversation
eric-wieser
commented
Jun 14, 2018
| def extend_all(module): | ||
| adict = {} | ||
| for a in __all__: | ||
| adict[a] = 1 |
Member
Author
There was a problem hiding this comment.
Possibly written before set() was available...
f43dd98 to
ebce412
Compare
ebce412 to
e2d83eb
Compare
mhvk
reviewed
Jun 14, 2018
Contributor
mhvk
left a comment
There was a problem hiding this comment.
Even just the added comments are worth it! Looks good modulo a small nitpick.
| # If two C types have the same size, then the earliest one in this list is used | ||
| # as the sized name. | ||
| _int_ctypes = ['long', 'longlong', 'int', 'short', 'byte'] | ||
| _uint_ctypes = list('u' + t for t in _int_ctypes) |
Contributor
There was a problem hiding this comment.
Total nitpick, but just ['u' + t for t in _int_ctypes] is faster (and clearer)
Member
Author
There was a problem hiding this comment.
A list comprehension would leak t into the module scope, unlike the above which does not.
Contributor
There was a problem hiding this comment.
Ah, had not thought about that - OK, would seem all good to go then!
Member
There was a problem hiding this comment.
Although I think that is fixed in recent Python
Member
Author
|
Follow-up at #10151 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bunch of small and somewhat orthogonal cleanups, all helping a little with #10151, and maybe #6103