jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
https://jcristharif.com/msgspec/
BSD 3-Clause "New" or "Revised" License
2.3k stars 67 forks source link

Python 3.7 support? #195

Closed FeeeeK closed 2 years ago

FeeeeK commented 2 years ago

I know this question has come up before, but #107 doesn't answer it. Python 3.7 is widely supported by many libraries and this makes it impossible to use msgspec with them. Can you explain exactly why the minimum version is 3.8?

jcrist commented 2 years ago

To achieve its high performance, msgspec is tightly coupled to the internals of the CPython VM. Supporting older versions of Python requires some effort on our part to maintain compatibility. 3.7 in particular would require a few shims at the CPython API layer, as well as compatibility for differences in the typing package between 3.7 and 3.8.

These compatibility differences are solvable with some effort, but they complicate the codebase. We have to draw a line somewhere (otherwise why not support 3.6? 3.5?). For consistency with a large part of the Python ecosystem, we choose to follow NEP 29, which at this time recommends supporting only 3.8+.

FeeeeK commented 2 years ago

Yeah, it makes sense to me now. Thanks for the information provided, now I'm thinking about ending support for python3.7 in my libraries.