gh-145650: Add logging.{Formatter,Filter}.__repr__#145652
gh-145650: Add logging.{Formatter,Filter}.__repr__#145652JackDanger wants to merge 5 commits intopython:mainfrom
logging.{Formatter,Filter}.__repr__#145652Conversation
logging.{Formatter,Filter}.__repr__
Lib/logging/__init__.py
Outdated
| return False | ||
| return (record.name[self.nlen] == ".") | ||
|
|
||
| def __repr__(self): |
There was a problem hiding this comment.
Put the __repr__ after __init__ please
There was a problem hiding this comment.
ah, great catch. Apologies for interactively rebasing a little fast and loose.
| self.assertAlmostEqual(relativeCreated, offset_ns / 1e6, places=7) | ||
|
|
||
|
|
||
| def test_formatter_repr(self): |
There was a problem hiding this comment.
Keep only 1 blank lines between methods.
Misc/NEWS.d/next/Library/2026-03-08-00-00-00.gh-issue-145650.LgRepr.rst
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,3 @@ | |||
| Add :func:`repr` support to :class:`http.client.HTTPConnection` and | |||
|
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 |
…gRepr.rst Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @picnixz: please review the changes made to this pull request. |
Add informative
__repr__implementations tologging.Formatterandlogging.Filter, consistent with the existing repr style used byHandlerandStreamHandler.Formatternow displays its format string:<Formatter (%(message)s)>Filterdisplays its filter name:<Filter (myapp)>Closes #145650