marshmallow-code / marshmallow-code/marshmallow
Type hinting for `load` is too strict
Open
help wanted
typing
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 738
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 7
Description
The type hinting for `load`'s `data` argument is set to `typing.Mapping` which makes sense for the `many=False` case, but for `many=True` case the type of `data` is `list`, which isn't a `Mapping` type.
Contributor guide
Research direction
Start at the load API and inspect the type annotation for its data argument, then trace how the many=True and many=False cases are represented. Update the annotation so both supported input shapes are covered, and add or adjust tests for loading a mapping and a list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100