33from __future__ import annotations
44
55import dataclasses
6+ from collections .abc import Iterable , Sequence
67from email .parser import HeaderParser
78from 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