| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks! Some thoughts.
Sorry, something went wrong.
| _frozen_ordered = dataclasses.dataclass(order=True, frozen=True) | ||
|
|
||
|
|
||
| @_frozen_ordered | ||
| class _Participant: | ||
| """Represent PEP participant.""" | ||
| full_name: str # The participant's name. | ||
| email: str # The participant's email address. | ||
|
|
||
|
|
||
| @_frozen_ordered | ||
| class _Author(_Participant): | ||
| """Represent PEP authors.""" | ||
| full_name: str # The author's name. | ||
| email: str # The author's email address. | ||
|
|
||
|
|
||
| @_frozen_ordered | ||
| class _Sponsor(_Participant): | ||
| """Represent PEP sponsors.""" |
There was a problem hiding this comment.
Consider not creating an alias here, obeying the locality of behavior rule (LoB) and keeping separate classes slightly more self-contained. Consider using dataclasses.field(doc=...).
| _frozen_ordered = dataclasses.dataclass(order=True, frozen=True) | |
| @_frozen_ordered | |
| class _Participant: | |
| """Represent PEP participant.""" | |
| full_name: str # The participant's name. | |
| email: str # The participant's email address. | |
| @_frozen_ordered | |
| class _Author(_Participant): | |
| """Represent PEP authors.""" | |
| full_name: str # The author's name. | |
| email: str # The author's email address. | |
| @_frozen_ordered | |
| class _Sponsor(_Participant): | |
| """Represent PEP sponsors.""" | |
| @dataclasses.dataclass(order=True, frozen=True) | |
| class _Participant: | |
| """Represent PEP participant.""" | |
| full_name: str = dataclasses.field(doc="The participant's name.") | |
| email: str = dataclasses.field(doc="The participant's email address.") | |
| @dataclasses.dataclass(order=True, frozen=True) | |
| class _Author(_Participant): | |
| """Represent PEP authors.""" | |
| full_name: str = dataclasses.field(doc="The author's name.") | |
| email: str = dataclasses.field(doc="The author's email address.") | |
| @dataclasses.dataclass(order=True, frozen=True) | |
| class _Sponsor(_Participant): | |
| """Represent PEP sponsors.""" |
Sorry, something went wrong.
|
|
||
|
|
||
|
|
||
| def _parse_author(data: str) -> list[_Author]: | ||
| """Return a list of author names and emails.""" | ||
| return [_Author(author, email) for author, email in _parse_participants(data)] | ||
|
|
||
| def _parse_sponsor(data: str) -> _Sponsor: | ||
| """Return sponsor name and email""" | ||
| return _Sponsor(*_parse_participants(data)[0]) |
There was a problem hiding this comment.
Formatting nits
| def _parse_author(data: str) -> list[_Author]: | |
| """Return a list of author names and emails.""" | |
| return [_Author(author, email) for author, email in _parse_participants(data)] | |
| def _parse_sponsor(data: str) -> _Sponsor: | |
| """Return sponsor name and email""" | |
| return _Sponsor(*_parse_participants(data)[0]) | |
| def _parse_author(data: str) -> list[_Author]: | |
| """Return a list of author names and emails.""" | |
| return [_Author(author, email) for author, email in _parse_participants(data)] | |
| def _parse_sponsor(data: str) -> _Sponsor: | |
| """Return sponsor name and email""" | |
| return _Sponsor(*_parse_participants(data)[0]) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Adds Sponsor information to the PEP details, targeted mostly for API access
📚 Documentation preview 📚: https://pep-previews--4804.org.readthedocs.build/