mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-03 07:45:14 +00:00
Allow accessing Object fields using square brackets
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user