Is there a Python equivalent to Perl's Data::Dumper for inspecting data structures?

前端 未结 11 1337
小鲜肉
小鲜肉 2020-12-10 00:19

Is there a Python module that can be used in the same way as Perl\'s Data::Dumper module?

Edit: Sorry, I should have been clearer. I was mainly afte

11条回答
  •  天涯浪人
    2020-12-10 00:54

    Isn't it true that all the answers ignore dumping anything else than a combination of the basic data types like lists, dicts, etc.? I have just ran pprint on an Python Xlib Window object and got… < 0x004001fe>… that's all. No data fields, no methods listed… Is there anything that does a real dump of an object? With e.g.: all its attributes?

提交回复
热议问题