Skip to content

Commit

Permalink
short
Browse files Browse the repository at this point in the history
  • Loading branch information
z44d committed Jul 21, 2024
1 parent ee725a5 commit 009d22b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,20 @@ def __str__(self) -> str:
else {
attr: getattr(obj, attr)
for attr in filter(
(lambda x: not x.startswith("_") and getattr(obj, x) is not None)
if JSONDESERIALIZABLE_SKIP_NONE
else (lambda x: not x.startswith("_")),
lambda x: not x.startswith("_")
and (
getattr(obj, x) is not None or not JSONDESERIALIZABLE_SKIP_NONE
),
obj.__dict__,
)
}
)
return (
json.dumps(
self, default=default, indent=2, ensure_ascii=False
)
json.dumps(self, default=default, indent=2, ensure_ascii=False)
if JSONDESERIALIZABLE_PARSE_OUTPUT
else str(
{
x: default(y)
if isinstance(y, JsonDeserializable)
else y
x: default(y) if isinstance(y, JsonDeserializable) else y
for x, y in self.__dict__.items()
if y is not None or not JSONDESERIALIZABLE_SKIP_NONE
}
Expand Down

0 comments on commit 009d22b

Please sign in to comment.