2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-31 06:16:06 +00:00

Use Optional[Type] instead of Union[Type, None]

This commit is contained in:
Dan
2022-04-11 14:34:29 +02:00
parent e8250bd576
commit 82b029c3bf
2 changed files with 2 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ def get_type_hint(type: str) -> str:
type = f"List[{get_type_hint(sub_type)}]"
if is_core:
return f"Union[None, {type}] = None" if is_flag else type
return f"Optional[{type}] = None" if is_flag else type
else:
ns, name = type.split(".") if "." in type else ("", type)
type = f'"raw.base.' + ".".join([ns, name]).strip(".") + '"'