Repository navigation
Commit 593ec54
authored
Fix dec_hook exception type in json.decode docstring (msgspec#1127)
Fixes msgspec#774.
`json.decode` was the only `dec_hook` docstring telling users to raise a
`TypeError` for an unsupported type. `json.Decoder`, `msgpack.decode`,
`msgpack.Decoder`, and `convert` all say `NotImplementedError`, which is
the
intended contract you confirmed in msgspec#774 (`TypeError`/`ValueError` are
for a
value that doesn't match the type). This changes the one line to match.
Grepped the rest of the tree for the wording and this docstring was the
only
copy, so there's nothing to fix in the docs or stubs. Added an `##
Unreleased`
changelog entry. I pointed it at the issue with `{issue}`774`` since
there was
no PR number when I wrote it; happy to swap it to `{pr}` with this PR's
number.
Disclosure: I used AI assistance (Claude) to draft this change and
reviewed the
result.1 parent a1ebbcd commit 593ec54
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19945 | 19945 | | |
19946 | 19946 | | |
19947 | 19947 | | |
19948 | | - | |
| 19948 | + | |
19949 | 19949 | | |
19950 | 19950 | | |
19951 | 19951 | | |
| |||
0 commit comments