diff --git a/mastodon/types.py b/mastodon/types.py index 28f402e..d71fa52 100644 --- a/mastodon/types.py +++ b/mastodon/types.py @@ -1,4 +1,4 @@ -from __future__ import annotations # pythong < 3.9 compat +from __future__ import annotations # python< 3.9 compat from datetime import datetime from typing import Union, Optional, Tuple, List, IO, Dict from mastodon.types_base import AttribAccessDict, IdType, MaybeSnowflakeIdType, PrimitiveIdType, EntityList, PaginatableList, NonPaginatableList, PathOrFile, WebpushCryptoParamsPubkey, WebpushCryptoParamsPrivkey, try_cast_recurse, try_cast diff --git a/mastodon/types_base.py b/mastodon/types_base.py index b88630a..29cd51d 100644 --- a/mastodon/types_base.py +++ b/mastodon/types_base.py @@ -1,4 +1,4 @@ -from __future__ import annotations # pythong < 3.9 compat +from __future__ import annotations # python < 3.9 compat from typing import List, Union, Optional, Dict, Any, Tuple, Callable, get_type_hints, TypeVar, IO, Generic from datetime import datetime, timezone import dateutil @@ -297,7 +297,12 @@ class NonPaginatableList(List[T]): """Lists in Mastodon.py are either regular or paginatable""" EntityList = Union[NonPaginatableList[T], PaginatableList[T]] -class AttribAccessDict(OrderedDict[str, Any]): +try: + OrderedStrDict = OrderedDict[str, Any] +except: + OrderedStrDict = OrderedDict + +class AttribAccessDict(OrderedStrDict): """ Base return object class for Mastodon.py.