Overview
msgspec 0.19, released on December 27, 2024, brings 40% faster JSON, __replace__ support, and drops Python 3.8.
Main Features
Faster JSON and __replace__
The JSON decoder is 40% faster. The __replace__ method (Python 3.13 copy/replace protocol) is supported on Structs.
python
import msgspec
import copy
class Config(msgspec.Struct):
host: str = 'localhost'
port: int = 8000
debug: bool = False
cfg = Config()
# __replace__: copy with modifications
prod = copy.replace(cfg, host='0.0.0.0', debug=False)
print(prod) # Config(host='0.0.0.0', port=8000, debug=False)
