From 5ba67e3b512477dc362fc6b40497f8ca92f2445f Mon Sep 17 00:00:00 2001 From: Boyan Date: Mon, 2 Dec 2024 18:27:33 +0100 Subject: [PATCH] Replaced | syntax with Optional (Python types <3) --- temmies/submission.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/temmies/submission.py b/temmies/submission.py index fd05431..53737b8 100644 --- a/temmies/submission.py +++ b/temmies/submission.py @@ -4,6 +4,7 @@ File to define the Submission class """ +from typing import Optional from bs4 import BeautifulSoup class Submission: @@ -48,7 +49,7 @@ class Submission: return results - def get_info(self) -> dict[str, str] | None: + def get_info(self) -> Optional[dict[str, str]]: """Submission information (in details)""" if self.__info: return self.__info @@ -74,7 +75,7 @@ class Submission: return self.__info return None - def get_files(self) -> list[str] | None: + def get_files(self) -> Optional[list[str]]: """Get a list of uploaded files in the format [(name, url)]""" if not self.__info: self.__info = self.get_info()