bpo-35082: Don't report deleted attributes in __dir__#10148
Merged
Conversation
88fa9f5 to
a734364
Compare
pablogsal
reviewed
Oct 27, 2018
pablogsal
approved these changes
Oct 27, 2018
a734364 to
89f5183
Compare
When an attribute is deleted from a Mock, a sentinel is added rather than just deleting the attribute. This commit checks for such sentinels when returning the child mocks in the __dir__ method as users won't expect deleted attributes to appear when performing dir(mock).
89f5183 to
e2c8f05
Compare
tirkarthi
approved these changes
Oct 27, 2018
Member
|
@cjw296 ping for review. |
cjw296
approved these changes
Apr 30, 2019
Contributor
|
Thanks @mariocj89 for the PR, and @cjw296 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Member
|
It seems the backport was never created by the bot to 3.7. @cjw296 would you be able to trigger it again? |
Contributor
|
Thanks @mariocj89 for the PR, and @cjw296 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Contributor
|
@Mariatta can you take a look, please. |
Member
|
Backport #13859 is created but it's not linked here. Issue number is missing in the backport title which could be a cause. |
|
GH-13859 is a backport of this pull request to the 3.7 branch. |
Contributor
|
Ok, fixed |
Member
|
Thanks @asvetlov |
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.
When an attribute is deleted from a Mock, a sentinel is added rather than just deleting the attribute. This commit checks for such sentinels when returning the child mocks in the dir method as users won't
expect deleted attributes to appear when performing dir(mock).
https://bugs.python.org/issue35082