Skip to content

Commit

Permalink
Improve static type checking (#225)
Browse files Browse the repository at this point in the history
* Improve static type checking

Add type annotation to is_too_long Function on apnstruncate.py file
as part of #201 issue

Signed-off-by: Omar Mohamed <[email protected]>
  • Loading branch information
kibablu authored May 25, 2021
1 parent 5ced57d commit 656c0ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/225.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve static type checking. Contributed by Omar Mohamed.
2 changes: 1 addition & 1 deletion sygnal/apnstruncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BodyTooLongException(Exception):
pass


def is_too_long(payload, max_length=2048):
def is_too_long(payload: dict, max_length: int = 2048) -> bool:
"""
Returns True if the given payload dictionary is too long for a push.
Note that the maximum is now 2kB "In iOS 8 and later" although in
Expand Down

0 comments on commit 656c0ea

Please sign in to comment.