Using JSON keys as attributes in nested JSON

前端 未结 3 587
失恋的感觉
失恋的感觉 2021-02-06 06:07

I\'m working with nested JSON-like data structures in python 2.7 that I exchange with some foreign perl code. I just want to \'work with\' these nested structures of lists and

3条回答
  •  滥情空心
    2021-02-06 06:31

    I found the answer: There is intentionally no way to automatically map the special methods in python, using __getattribute__. So to achieve what I want, I need to explicitely define all special methods like __len__ one after the other.

提交回复
热议问题