Skip to content

Commit fcbeb7c

Browse files
committed
Use typing.List for type hints (fix for py <3.9)
1 parent 2c2633e commit fcbeb7c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

xbox/webapi/common/ratelimits/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datetime import datetime, timedelta
2-
from typing import Union
2+
from typing import Union, List
33

44
from xbox.webapi.common.ratelimits.models import (
55
ParsedRateLimit,
@@ -173,10 +173,12 @@ def get_reset_after(self) -> Union[datetime, None]:
173173
# dates_valid has no elements, return None
174174
return None
175175

176-
def get_limits(self) -> list[SingleRateLimit]:
176+
# list -> List (typing.List) https://stackoverflow.com/a/63460173
177+
def get_limits(self) -> List[SingleRateLimit]:
177178
return self.__limits
178179

179-
def get_limits_by_period(self, period: TimePeriod) -> list[SingleRateLimit]:
180+
# list -> List (typing.List) https://stackoverflow.com/a/63460173
181+
def get_limits_by_period(self, period: TimePeriod) -> List[SingleRateLimit]:
180182
# Filter the list for the given LimitType
181183
matches = filter(lambda limit: limit.get_time_period() == period, self.__limits)
182184
# Convert the filter object to a list and return it

0 commit comments

Comments
 (0)