Skip to content

Commit e99d6ef

Browse files
committed
Use a list of authors in peps.json
1 parent 41a1c11 commit e99d6ef

File tree

1 file changed

+9
-3
lines changed
  • pep_sphinx_extensions/pep_zero_generator

1 file changed

+9
-3
lines changed

pep_sphinx_extensions/pep_zero_generator/parser.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import dataclasses
6+
from collections.abc import Iterable, Sequence
67
from email.parser import HeaderParser
78
from pathlib import Path
89

@@ -121,6 +122,11 @@ def __lt__(self, other: PEP) -> bool:
121122
def __eq__(self, other):
122123
return self.number == other.number
123124

125+
@property
126+
def _author_names(self) -> Iterable[str]:
127+
"""An iterator of the authors' full names."""
128+
return (author.full_name for author in self.authors)
129+
124130
@property
125131
def shorthand(self) -> str:
126132
"""Return reStructuredText tooltip for the PEP type and status."""
@@ -139,18 +145,18 @@ def details(self) -> dict[str, str | int]:
139145
# a tooltip representing the type and status
140146
"shorthand": self.shorthand,
141147
# the author list as a comma-separated with only last names
142-
"authors": ", ".join(author.full_name for author in self.authors),
148+
"authors": ", ".join(self._author_names),
143149
# The targeted Python-Version (if present) or the empty string
144150
"python_version": self.python_version or "",
145151
}
146152

147153
@property
148-
def full_details(self) -> dict[str, str | int]:
154+
def full_details(self) -> dict[str, str | int | Sequence[str]]:
149155
"""Returns all headers of the PEP as a dict."""
150156
return {
151157
"number": self.number,
152158
"title": self.title,
153-
"authors": ", ".join(author.full_name for author in self.authors),
159+
"authors": tuple(self._author_names),
154160
"discussions_to": self.discussions_to,
155161
"status": self.status,
156162
"type": self.pep_type,

0 commit comments

Comments
 (0)