Skip to content

Commit

Permalink
additional crimes
Browse files Browse the repository at this point in the history
  • Loading branch information
halcy authored and halcy committed Jun 23, 2023
1 parent 97f6551 commit 4941b9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mastodon/types.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 7 additions & 2 deletions mastodon/types_base.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 4941b9e

Please sign in to comment.