Python: Add missing builtins to API::builtin#5639
Merged
Merged
Conversation
We were missing out on `None`, `True`, and `False` as these do not appear as actual attributes of the `builtins` module in Python 3 (because they are elevated to the status of keywords there) The simple solution, then, is to just always include them directly.
yoff
approved these changes
Apr 12, 2021
yoff
left a comment
Contributor
There was a problem hiding this comment.
I wonder how many nodes this will add to likely_builtin on a large code base. Should we run the usual performance check just in case?
Member
I think the risk for this introducing a problem is very minimal. So I think this raises the question of whether we want to run performance tests on all our PRs. While it is much easier now, I still think it negatively impacts our velocity. Let's discuss at our meeting later today 😊 |
Contributor
Author
|
Ran a performance test anyway. Looks pretty reasonable: https://github.com/dsp-testing/tausbn-dca/issues/10 |
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.
We were missing out on
None,True, andFalseas these do notappear as actual attributes of the
builtinsmodule in Python 3(because they are elevated to the status of keywords there).
The simple solution, then, is to just always include them directly.
cf. #3878 where
API::builtin("None")would come in handy.This is a minor bugfix, and so I don't think a change note is required.