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:
parent
274650cda9
commit
4ebf5cf7e9
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user