Skip to content

Fix msgspec.msgpack.Ext types - #1053

Merged
sobolevn merged 3 commits into
msgspec:mainfrom
sobolevn:generic-ext
Jun 12, 2026
Merged

Fix msgspec.msgpack.Ext types#1053
sobolevn merged 3 commits into
msgspec:mainfrom
sobolevn:generic-ext

Conversation

@sobolevn

Copy link
Copy Markdown
Member

Several typing improvments:

  1. msgspec.msgpack.Enc now accepts all buffers, not just bytes | memoryview | bytearray. I've added a runtime test to proove that
  2. Renamed T and other typing-only utils to be protected names: T and _enc_hook_sig can't be imported from msgspec.msgpack in runtime

@provinzkraut

Copy link
Copy Markdown
Member

Same things seem to apply to json.pyi. Do you wanna add that to this PR?

@sobolevn

Copy link
Copy Markdown
Member Author

I would prefer to analyze all modules one by one, there are multiple type errors there as well :)

Comment thread src/msgspec/msgpack.pyi Outdated
@sobolevn
sobolevn added this pull request to the merge queue Jun 12, 2026
@sobolevn
sobolevn removed this pull request from the merge queue due to a manual request Jun 12, 2026
@sobolevn
sobolevn added this pull request to the merge queue Jun 12, 2026
@sobolevn
sobolevn removed this pull request from the merge queue due to a manual request Jun 12, 2026
@sobolevn sobolevn closed this Jun 12, 2026
@sobolevn sobolevn reopened this Jun 12, 2026
@sobolevn
sobolevn enabled auto-merge June 12, 2026 10:46
@sobolevn
sobolevn added this pull request to the merge queue Jun 12, 2026
Merged via the queue into msgspec:main with commit a216994 Jun 12, 2026
36 checks passed
@sobolevn
sobolevn deleted the generic-ext branch June 12, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants