2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Remove ability to access attributes via bracket notation

This commit is contained in:
Dan 2022-04-24 11:56:06 +02:00
parent 274650cda9
commit 4ebf5cf7e9
2 changed files with 0 additions and 12 deletions

View File

@ -78,11 +78,5 @@ class TLObject:
def __len__(self) -> int:
return len(self.write())
def __getitem__(self, item: Any) -> Any:
return getattr(self, item)
def __setitem__(self, key: Any, value: Any) -> Any:
setattr(self, key, value)
def __call__(self, *args: Any, **kwargs: Any) -> Any:
pass

View File

@ -94,12 +94,6 @@ class Object(metaclass=Meta):
return True
def __getitem__(self, item):
return getattr(self, item)
def __setitem__(self, key, value):
setattr(self, key, value)
def __getstate__(self):
new_dict = self.__dict__.copy()
new_dict.pop("_client", None)