mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2026-06-19 07:35:19 +00:00
Make instantiation of TelegramObjects 15% faster (#5250)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
other = "Make instantiation of ``TelegramObject``'s 15% faster"
|
||||
[[pull_requests]]
|
||||
uid = "5250"
|
||||
author_uids = ["harshil21"]
|
||||
closes_threads = []
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user