Enforced variable types

This commit is contained in:
2025-08-02 03:14:38 +02:00
parent 7ad8b14fdc
commit 9726a3018e
2 changed files with 4 additions and 4 deletions

View File

@ -7,9 +7,9 @@ from PIL.ImageFile import ImageFile
class Post:
def __init__(self, id: int, image_dir: int, image_id: str, tags: list[str]):
self.id: int = id
self.image_dir: int = image_dir
self.image_id: str = image_id
self.id: int = int(id)
self.image_dir: int = int(image_dir)
self.image_id: str = str(image_id)
self.tags: list[str] = tags.copy()
self.thumbnail_data: bytes = scraper.get(f"https://wimg.rule34.xxx/thumbnails/{self.image_dir}/thumbnail_{self.image_id}.jpg")
self.thumbnail: ImageFile = Image.open(BytesIO(self.thumbnail_data))

View File

@ -34,7 +34,7 @@ class ViewTags:
class View:
def __init__(self, id: int):
self.id = id
self.id = int(id)
self._image_data: bytes | None = None
self._image: ImageFile | None = None
self._image_url: ImageURL | None = None