Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 pyAMF 并且确实收到了一个TypedObject实际上是嵌套字典的内容。我想将其转换为 python 字典。
TypedObject
您应该能够将其包装dict(obj)或调用obj.copy()以进行转换:
dict(obj)
obj.copy()
>>> type(o) <class 'pyamf.TypedObject'> >>> type(o.copy()) <type 'dict'> >>> o.copy() {'abc': 123}