Skip to content

Infra: Add Sponsor to the PEPs API#4804

Open
Secrus wants to merge 1 commit intopython:mainfrom
Secrus:add-sponsor-to-api
Open

Infra: Add Sponsor to the PEPs API#4804
Secrus wants to merge 1 commit intopython:mainfrom
Secrus:add-sponsor-to-api

Conversation

@Secrus
Copy link
Contributor

@Secrus Secrus commented Feb 3, 2026

Adds Sponsor information to the PEP details, targeted mostly for API access


📚 Documentation preview 📚: https://pep-previews--4804.org.readthedocs.build/

@Secrus Secrus requested a review from AA-Turner as a code owner February 3, 2026 13:20
@python-cla-bot
Copy link

python-cla-bot bot commented Feb 3, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@Secrus Secrus force-pushed the add-sponsor-to-api branch from 550a6c9 to 139ad22 Compare February 3, 2026 13:21
@Secrus Secrus marked this pull request as draft February 3, 2026 13:22
@Secrus Secrus force-pushed the add-sponsor-to-api branch 3 times, most recently from c794e17 to 2680d2c Compare February 3, 2026 13:34
@hugovk hugovk added the infra Core infrastructure for building and rendering PEPs label Feb 3, 2026
@hugovk hugovk changed the title Add Sponsor to the PEP API Infra: Add Sponsor to the PEPs API Feb 3, 2026
@Secrus Secrus force-pushed the add-sponsor-to-api branch from 2680d2c to 8d14d70 Compare February 3, 2026 13:37
@Secrus Secrus marked this pull request as ready for review February 3, 2026 13:40
Copy link
Member

@johnslavik johnslavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some thoughts.

Comment on lines +21 to +38
_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."""
Copy link
Member

@johnslavik johnslavik Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=...).

Suggested change
_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."""

Comment on lines +221 to +230



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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting nits

Suggested change
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])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Core infrastructure for building and rendering PEPs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants