Skip to content

Annotate types without Py_TPFLAGS_BASETYPE as @final#1043

Merged
provinzkraut merged 4 commits into
msgspec:mainfrom
sobolevn:final-types
Jun 10, 2026
Merged

Annotate types without Py_TPFLAGS_BASETYPE as @final#1043
provinzkraut merged 4 commits into
msgspec:mainfrom
sobolevn:final-types

Conversation

@sobolevn

@sobolevn sobolevn commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Annotate types that can't be used as base classes:

>>> import msgspec

>>> class A(msgspec.Raw): ...
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    class A(msgspec.Raw): ...
TypeError: type 'msgspec.Raw' is not an acceptable base type

>>> class A(msgspec.Meta): ...
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    class A(msgspec.Meta): ...
TypeError: type 'msgspec.Meta' is not an acceptable base type

@provinzkraut provinzkraut added this pull request to the merge queue Jun 10, 2026
Merged via the queue into msgspec:main with commit 29cf293 Jun 10, 2026
23 checks passed
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