Skip to content

Commit 31d8aeb

Browse files
committed
Add a new field
1 parent d72de34 commit 31d8aeb

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

pep_sphinx_extensions/pep_zero_generator/parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def details(self) -> dict[str, str | int]:
144144
"title": self.title,
145145
# a tooltip representing the type and status
146146
"shorthand": self.shorthand,
147-
# the author list as a comma-separated with only last names
147+
# the comma-separated list of authors
148148
"authors": ", ".join(self._author_names),
149149
# The targeted Python-Version (if present) or the empty string
150150
"python_version": self.python_version or "",
@@ -156,7 +156,7 @@ def full_details(self) -> dict[str, str | int | Sequence[str]]:
156156
return {
157157
"number": self.number,
158158
"title": self.title,
159-
"authors": tuple(self._author_names),
159+
"authors": ", ".join(self._author_names),
160160
"discussions_to": self.discussions_to,
161161
"status": self.status,
162162
"type": self.pep_type,
@@ -168,6 +168,8 @@ def full_details(self) -> dict[str, str | int | Sequence[str]]:
168168
"requires": self.requires,
169169
"replaces": self.replaces,
170170
"superseded_by": self.superseded_by,
171+
# extra non-header keys for use in ``peps.json``
172+
"author_names": tuple(self._author_names),
171173
"url": f"https://peps.python.org/pep-{self.number:0>4}/",
172174
}
173175

peps/api/index.rst

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ illustrating some of the possible values for each field:
4242
"12": {
4343
"number": 12,
4444
"title": "Sample reStructuredText PEP Template",
45-
"authors": [
46-
"David Goodger",
47-
"Barry Warsaw",
48-
"Brett Cannon"
49-
],
45+
"authors": "David Goodger, Barry Warsaw, Brett Cannon",
5046
"discussions_to": null,
5147
"status": "Active",
5248
"type": "Process",
@@ -58,14 +54,17 @@ illustrating some of the possible values for each field:
5854
"requires": null,
5955
"replaces": null,
6056
"superseded_by": null,
57+
"author_names": [
58+
"David Goodger",
59+
"Barry Warsaw",
60+
"Brett Cannon"
61+
],
6162
"url": "https://peps.python.org/pep-0012/"
6263
},
6364
"160": {
6465
"number": 160,
6566
"title": "Python 1.6 Release Schedule",
66-
"authors": [
67-
"Fred L. Drake, Jr."
68-
],
67+
"authors": "Fred L. Drake, Jr.",
6968
"discussions_to": null,
7069
"status": "Final",
7170
"type": "Informational",
@@ -77,14 +76,15 @@ illustrating some of the possible values for each field:
7776
"requires": null,
7877
"replaces": null,
7978
"superseded_by": null,
79+
"author_names": [
80+
"Fred L. Drake, Jr."
81+
],
8082
"url": "https://peps.python.org/pep-0160/"
8183
},
8284
"3124": {
8385
"number": 3124,
8486
"title": "Overloading, Generic Functions, Interfaces, and Adaptation",
85-
"authors": [
86-
"Phillip J. Eby"
87-
],
87+
"authors": "Phillip J. Eby",
8888
"discussions_to": "python-3000@python.org",
8989
"status": "Deferred",
9090
"type": "Standards Track",
@@ -96,6 +96,9 @@ illustrating some of the possible values for each field:
9696
"requires": "3107, 3115, 3119",
9797
"replaces": "245, 246",
9898
"superseded_by": null,
99+
"author_names": [
100+
"Phillip J. Eby"
101+
],
99102
"url": "https://peps.python.org/pep-3124/"
100103
}
101104
}

0 commit comments

Comments
 (0)