Simon Willison’s Weblog

Subscribe

Tuesday, 7th January 2020

Better Python Object Serialization. TIL about functions.singledispatch, a decorator which makes it easy to create Python functions with implementations that vary based on the type of their arguments and which can have additional implementations registered after the fact—great for things like custom JSON serialization.

# 8:35 pm / functional-programming, json, python, serialization

Monday, 6th January 2020
Wednesday, 8th January 2020