mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Patched code generator and updated README.rst removing markdown leftovers
This commit is contained in:
@@ -2,6 +2,9 @@ import re
|
||||
|
||||
|
||||
class TLObject:
|
||||
""".tl core types IDs (such as vector, booleans, etc.)"""
|
||||
CORE_TYPES = (0x1cb5c415, 0xbc799737, 0x997275b5, 0x3fedd339)
|
||||
|
||||
def __init__(self, fullname, id, args, result, is_function):
|
||||
"""
|
||||
Initializes a new TLObject, given its properties.
|
||||
@@ -73,6 +76,11 @@ class TLObject:
|
||||
result=match.group(3),
|
||||
is_function=is_function)
|
||||
|
||||
def is_core_type(self):
|
||||
"""Determines whether the TLObject is a "core type"
|
||||
(and thus should be embedded in the generated code) or not"""
|
||||
return self.id in TLObject.CORE_TYPES
|
||||
|
||||
def __repr__(self):
|
||||
fullname = ('{}.{}'.format(self.namespace, self.name) if self.namespace is not None
|
||||
else self.name)
|
||||
|
Reference in New Issue
Block a user