mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-31 20:54:51 +00:00
Allow accessing Object fields using square brackets
This commit is contained in:
parent
83c4ba8a78
commit
41ff375f08
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Reference in a new issue