mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 12:57:52 +00:00
Allow accessing Object fields using square brackets
This commit is contained in:
parent
83c4ba8a78
commit
41ff375f08
@ -46,6 +46,9 @@ class Object:
|
||||
def __call__(self):
|
||||
pass
|
||||
|
||||
def __getitem__(self, item):
|
||||
return getattr(self, item)
|
||||
|
||||
|
||||
class Encoder(JSONEncoder):
|
||||
def default(self, o: Object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user