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.44k stars 75 forks source link

Use positional-only args in certain function sigs #746

Closed jcrist closed 1 month ago

jcrist commented 1 month ago

Previously the type signatures noted for the json and msgpack modules weren't strictly accurate. The implementation only accepted positional args for certain parameters, but the signatures defined them as positional-or-keyword parameters. This PR rectifies that.

Note that this is not a change in behavior, this is only a change in the signatures that tools like mypy or pyright would use to check your code.

Fixes #705.