Skip to content

Commit 780a36a

Browse files
committed
Correctly annotate input parameters
1 parent 623fe57 commit 780a36a

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

edupage_api/classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Optional
2+
from typing import Optional, Union
33

44
from edupage_api.classrooms import Classroom, Classrooms
55
from edupage_api.dbi import DbiHelper
@@ -56,7 +56,7 @@ def get_classes(self) -> Optional[list]:
5656

5757
return classes
5858

59-
def get_class(self, class_id: int | str) -> Optional[Class]:
59+
def get_class(self, class_id: Union[int, str]) -> Optional[Class]:
6060
try:
6161
class_id = int(class_id)
6262
except (ValueError, TypeError):

edupage_api/classrooms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Optional
2+
from typing import Optional, Union
33

44
from edupage_api.dbi import DbiHelper
55
from edupage_api.module import Module, ModuleHelper
@@ -36,7 +36,7 @@ def get_classrooms(self) -> Optional[list]:
3636

3737
return classrooms
3838

39-
def get_classroom(self, classroom_id: int | str) -> Optional[Classroom]:
39+
def get_classroom(self, classroom_id: Union[int, str]) -> Optional[Classroom]:
4040
try:
4141
classroom_id = int(classroom_id)
4242
except (ValueError, TypeError):

edupage_api/people.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from dataclasses import dataclass
66
from datetime import datetime
77
from enum import Enum
8-
from typing import Optional
8+
from typing import Optional, Union
99

1010
from edupage_api.dbi import DbiHelper
1111
from edupage_api.module import EdupageModule, Module, ModuleHelper
@@ -215,7 +215,7 @@ def get_all_students(self) -> Optional[list[EduStudent]]:
215215
return result
216216

217217
@ModuleHelper.logged_in
218-
def get_teacher(self, teacher_id: int | str) -> Optional[EduTeacher]:
218+
def get_teacher(self, teacher_id: Union[int, str]) -> Optional[EduTeacher]:
219219
try:
220220
teacher_id = int(teacher_id)
221221
except (ValueError, TypeError):
@@ -231,7 +231,7 @@ def get_teacher(self, teacher_id: int | str) -> Optional[EduTeacher]:
231231
)
232232

233233
@ModuleHelper.logged_in
234-
def get_student(self, student_id: int | str) -> Optional[EduStudent]:
234+
def get_student(self, student_id: Union[int, str]) -> Optional[EduStudent]:
235235
try:
236236
student_id = int(student_id)
237237
except (ValueError, TypeError):

edupage_api/subjects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from dataclasses import dataclass
2-
from typing import Optional
2+
from typing import Optional, Union
33

44
from edupage_api.dbi import DbiHelper
55
from edupage_api.module import Module, ModuleHelper
@@ -36,7 +36,7 @@ def get_subjects(self) -> Optional[list]:
3636

3737
return subjects
3838

39-
def get_subject(self, subject_id: int | str) -> Optional[Subject]:
39+
def get_subject(self, subject_id: Union[int, str]) -> Optional[Subject]:
4040
try:
4141
subject_id = int(subject_id)
4242
except (ValueError, TypeError):

0 commit comments

Comments
 (0)