From 4941b9e386df92945544a4fc1aec6db3b86d2b04 Mon Sep 17 00:00:00 2001 From: halcy Date: Sat, 24 Jun 2023 00:44:26 +0300 Subject: [PATCH] additional crimes --- mastodon/types.py | 2 +- mastodon/types_base.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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.