Make instantiation of TelegramObjects 15% faster (#5250)

This commit is contained in:
Harshil
2026-05-31 12:47:47 -04:00
committed by GitHub
parent 4ad65a3b40
commit 1f343592de
2 changed files with 7 additions and 2 deletions
@@ -0,0 +1,5 @@
other = "Make instantiation of ``TelegramObject``'s 15% faster"
[[pull_requests]]
uid = "5250"
author_uids = ["harshil21"]
closes_threads = []
+2 -2
View File
@@ -154,7 +154,7 @@ class TelegramObject:
:exc:`AttributeError`
"""
# protected attributes can always be set for convenient internal use
if key[0] == "_" or not getattr(self, "_frozen", True):
if key[0] == "_" or not self._frozen:
super().__setattr__(key, value)
return
@@ -169,7 +169,7 @@ class TelegramObject:
:exc:`AttributeError`
"""
# protected attributes can always be set for convenient internal use
if key[0] == "_" or not getattr(self, "_frozen", True):
if key[0] == "_" or not self._frozen:
super().__delattr__(key)
return