jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML

Home Page:https://jcristharif.com/msgspec/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convert builtin types to numpy

i-newton opened this issue · comments

Question

I would like to convert some built-in types to numpy dtype instances in order to save some memory, numpy fields are part of msgspec struct. Is it possible to do in msgspec? Should i use dec_hook here, i failed to find any example fot the issue.

Hi, thanks for opening this. I'm not sure I understand the question - can you provide an example (pseudocode) showing what you would like to happen? I can then (hopefully) show you how to make that example work with msgspec.