From 1a7a11eaf340b43b14ad2ccb47107a6a3980353e Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 28 Apr 2022 03:45:56 -0400 Subject: [PATCH] Optional instead of | union --- matrix_appservice_kakaotalk/kt/types/bson.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix_appservice_kakaotalk/kt/types/bson.py b/matrix_appservice_kakaotalk/kt/types/bson.py index 40fae9d..d6201e4 100644 --- a/matrix_appservice_kakaotalk/kt/types/bson.py +++ b/matrix_appservice_kakaotalk/kt/types/bson.py @@ -13,7 +13,7 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from typing import Any +from typing import Any, Optional from mautrix.types import Serializable, JSON @@ -26,5 +26,5 @@ class Long(int, Serializable): def deserialize(cls, raw: JSON) -> "Long": return cls(raw) -def to_optional_long(x: Any | None) -> Long | None: +def to_optional_long(x: Optional[Any]) -> Optional[Long]: return Long(x) if x is not None else None