mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-01 23:05:15 +00:00
Remove ability to access attributes via bracket notation
This commit is contained in:
@@ -78,11 +78,5 @@ class TLObject:
|
|||||||
def __len__(self) -> int:
|
def __len__(self) -> int:
|
||||||
return len(self.write())
|
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:
|
def __call__(self, *args: Any, **kwargs: Any) -> Any:
|
||||||
pass
|
pass
|
||||||
|
@@ -94,12 +94,6 @@ class Object(metaclass=Meta):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def __getitem__(self, item):
|
|
||||||
return getattr(self, item)
|
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
|
||||||
setattr(self, key, value)
|
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
new_dict = self.__dict__.copy()
|
new_dict = self.__dict__.copy()
|
||||||
new_dict.pop("_client", None)
|
new_dict.pop("_client", None)
|
||||||
|
Reference in New Issue
Block a user