gh-153906: Show 'Data' in code formatting (#154132)

hugovk <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/69d44f80b55633baabe1d53b6c9a629348a93dca
commit: 69d44f80b55633baabe1d53b6c9a629348a93dca
branch: main
author: Hugo van Kemenade <[email protected]>
committer: hugovk <[email protected]>
date: 2026-07-19T17:45:17+03:00
summary:

gh-153906: Show 'Data' in code formatting (#154132)

files:
M Lib/pydoc.py

diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 3140723f49b7d0..72974af26bee64 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -881,9 +881,10 @@ def docmodule(self, object, name=None, mod=None, *ignored):
         if data:
             contents = []
             for key, value in data:
-                contents.append(self.document(value, key))
+                contents.append(
+                    f'<dl class="doc"><dt>{self.document(value, key)}</dt></dl>')
             result = result + self.bigsection(
-                'Data', 'data', '<br>\n'.join(contents))
+                'Data', 'data', '\n'.join(contents))
         if hasattr(object, '__author__'):
             contents = self.markup(str(object.__author__), self.preformat)
             result = result + self.bigsection('Author', 'author', contents)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.