mirror of
https://github.com/element-hq/synapse
synced 2024-09-12 05:55:11 +00:00
docstringggggg
This commit is contained in:
parent
ad6a6675bf
commit
0953cad3e4
1 changed files with 4 additions and 0 deletions
|
@ -250,4 +250,8 @@ def base62_encode(num: int, minwidth: int = 1) -> str:
|
|||
|
||||
|
||||
def non_null_str_or_none(val: Any) -> Optional[str]:
|
||||
"""Check that the arg is a string containing no null (U+0000) codepoints.
|
||||
|
||||
If so, returns the given string unmodified; otherwise, returns None.
|
||||
"""
|
||||
return val if isinstance(val, str) and "\u0000" not in val else None
|
||||
|
|
Loading…
Reference in a new issue