Skip to content

Commit bf83f57

Browse files
SpEcHiDenull-nick
andcommitted
(fix): type hinting on raw base types
PyrogramMod/PyrogramMod@1aba00a PyrogramMod/PyrogramMod@a768130 Co-authored-by: null-nick <[email protected]>
1 parent 1f056a1 commit bf83f57

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

compiler/api/template/type.txt

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,8 @@
44

55
from typing import Union
66
from pyrogram import raw
7-
from pyrogram.raw.core import TLObject
87

98
{name} = Union[{types}]
10-
11-
12-
# noinspection PyRedeclaration
13-
class {name}: # type: ignore
14-
"""{docstring}
15-
"""
16-
17-
QUALNAME = "pyrogram.raw.base.{qualname}"
18-
19-
def __init__(self):
20-
raise TypeError(
21-
"Base types can only be used for type checking purposes: "
22-
"you tried to use a base type instance as argument, "
23-
"but you need to instantiate one of its constructors instead. "
24-
"More info: https://telegramplayground.github.io/pyrogram/telegram/base/{doc_name}"
25-
)
9+
{name}.__doc__ = """
10+
{docstring}
11+
"""

0 commit comments

Comments
 (0)