Skip to content

Commit

Permalink
Fix opts typing (#2744)
Browse files Browse the repository at this point in the history
* Fix opts typing

* Update changelog
  • Loading branch information
sloria authored Jan 9, 2025
1 parent 73a3569 commit 5eb2242
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ Changelog

Features:

- Typing: Improve type annotations for ``SchemaMeta.get_declared_fields``.
- Typing: Improve type annotations for ``SchemaMeta.get_declared_fields`` (:pr:`2742`).

Bug fixes:

- Typing: Relax type annotation for ``Schema.opts`` to allow subclasses to define their own
options classes (:pr:`2744`).

3.24.2 (2025-01-08)
*******************
Expand Down
2 changes: 1 addition & 1 deletion src/marshmallow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class AlbumSchema(Schema):
set_class = OrderedSet

# These get set by SchemaMeta
opts: SchemaOpts
opts: typing.Any
_declared_fields: dict[str, ma_fields.Field] = {}
_hooks: dict[str, list[tuple[str, bool, dict]]] = {}

Expand Down

0 comments on commit 5eb2242

Please sign in to comment.