Skip to content

Commit

Permalink
🔨 Have API.pep_file return a Path rather than a string
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Jan 28, 2025
1 parent 495f94b commit dd2bcc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/peplum/peps/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

##############################################################################
# Python imports.
from pathlib import Path
from ssl import SSLCertVerificationError
from typing import Any, Final

Expand Down Expand Up @@ -81,7 +82,7 @@ async def get_peps(self) -> dict[int, dict[str, Any]]:
raise RequestError("Unexpected data received from the PEP API")

@staticmethod
def pep_file(pep: int) -> str:
def pep_file(pep: int) -> Path:
"""Generate the name of the source file of a PEP.
Args:
Expand All @@ -90,7 +91,7 @@ def pep_file(pep: int) -> str:
Returns:
The name of the source file for that PEP.
"""
return f"pep-{pep:04}.rst"
return Path(f"pep-{pep:04}.rst")

@classmethod
def pep_url(cls, pep: int) -> str:
Expand Down

0 comments on commit dd2bcc3

Please sign in to comment.