Skip to content

Commit

Permalink
Add a new field
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Jan 24, 2025
1 parent d72de34 commit 31d8aeb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
6 changes: 4 additions & 2 deletions pep_sphinx_extensions/pep_zero_generator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def details(self) -> dict[str, str | int]:
"title": self.title,
# a tooltip representing the type and status
"shorthand": self.shorthand,
# the author list as a comma-separated with only last names
# the comma-separated list of authors
"authors": ", ".join(self._author_names),
# The targeted Python-Version (if present) or the empty string
"python_version": self.python_version or "",
Expand All @@ -156,7 +156,7 @@ def full_details(self) -> dict[str, str | int | Sequence[str]]:
return {
"number": self.number,
"title": self.title,
"authors": tuple(self._author_names),
"authors": ", ".join(self._author_names),
"discussions_to": self.discussions_to,
"status": self.status,
"type": self.pep_type,
Expand All @@ -168,6 +168,8 @@ def full_details(self) -> dict[str, str | int | Sequence[str]]:
"requires": self.requires,
"replaces": self.replaces,
"superseded_by": self.superseded_by,
# extra non-header keys for use in ``peps.json``
"author_names": tuple(self._author_names),
"url": f"https://peps.python.org/pep-{self.number:0>4}/",
}

Expand Down
25 changes: 14 additions & 11 deletions peps/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ illustrating some of the possible values for each field:
"12": {
"number": 12,
"title": "Sample reStructuredText PEP Template",
"authors": [
"David Goodger",
"Barry Warsaw",
"Brett Cannon"
],
"authors": "David Goodger, Barry Warsaw, Brett Cannon",
"discussions_to": null,
"status": "Active",
"type": "Process",
Expand All @@ -58,14 +54,17 @@ illustrating some of the possible values for each field:
"requires": null,
"replaces": null,
"superseded_by": null,
"author_names": [
"David Goodger",
"Barry Warsaw",
"Brett Cannon"
],
"url": "https://peps.python.org/pep-0012/"
},
"160": {
"number": 160,
"title": "Python 1.6 Release Schedule",
"authors": [
"Fred L. Drake, Jr."
],
"authors": "Fred L. Drake, Jr.",
"discussions_to": null,
"status": "Final",
"type": "Informational",
Expand All @@ -77,14 +76,15 @@ illustrating some of the possible values for each field:
"requires": null,
"replaces": null,
"superseded_by": null,
"author_names": [
"Fred L. Drake, Jr."
],
"url": "https://peps.python.org/pep-0160/"
},
"3124": {
"number": 3124,
"title": "Overloading, Generic Functions, Interfaces, and Adaptation",
"authors": [
"Phillip J. Eby"
],
"authors": "Phillip J. Eby",
"discussions_to": "python-3000@python.org",
"status": "Deferred",
"type": "Standards Track",
Expand All @@ -96,6 +96,9 @@ illustrating some of the possible values for each field:
"requires": "3107, 3115, 3119",
"replaces": "245, 246",
"superseded_by": null,
"author_names": [
"Phillip J. Eby"
],
"url": "https://peps.python.org/pep-3124/"
}
}

0 comments on commit 31d8aeb

Please sign in to comment.