bpo-43858: Add logging.getLevelNamesMapping() by akulakov · Pull Request #26459 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs tests. In particular it should add tests that a copy is returned.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again
. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
I have made the requested changes; please review again
Thanks for making the requested changes!
@ericvsmith: please review the changes made to this pull request.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me. @vsajip : I'll let you have the final word.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again
. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
@@ -0,0 +1 @@ |
---|
Added a function that returns a copy of a dict of logging levels: func::`logging.getLevelNamesMapping()` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I look at this: isn't the correct syntax:
:func:`logging.getLevelNamesMapping`
?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, well spotted!
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the one small item I mentioned, this looks good to me.
@@ -0,0 +1 @@ |
---|
Added a function that returns a copy of a dict of logging levels: :func:`logging.getLevelNamesMapping()` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that :func:
adds the parens, so you should leave them off in this message. I've looked at other files, and they don't have the parens.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental double-definition in test?
@@ -4390,6 +4390,15 @@ def rec(): |
---|
self.assertNotIn("Cannot recover from stack overflow.", err) |
self.assertEqual(rc, 1) |
def test_get_level_names_mapping(self): |
def test_get_level_names_mapping(self): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you meant this double level of indentation! That causes the test to do nothing effective 😞
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, somehow doubling made it hard to spot for me..
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me. Thanks, @akulakov !
akulakov changed the title
bpo-43858: Add logging.getLevelNamesDict() bpo-43858: Add logging.getLevelNamesMapping()