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.
使用高速公路进行 RPC 时,高速公路支持返回 python 对象的过程,只要它们是 json 可序列化的。我想返回的一些对象默认情况下不是 json 可序列化的。我可以轻松编写自定义编码器,但高速公路如何知道它需要使用它?
你可以覆盖你_serialize的_unserialize工厂。见这里。请注意,此 API(当前)不承诺是稳定的。
_serialize
_unserialize