marshmallow-code / marshmallow-code/marshmallow
allow for overriding dump’s iteration behavior
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 738
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 7
Description
Currently at: https://github.com/marshmallow-code/marshmallow/blob/1781e9a18895aa9b473fb5587de3cf922416733e/marshmallow/schema.py#L396-L397 iteration behavior is determined by list(). Would it be considered a useful feature to be able to override this behavior with a function that takes the object and returns an iterator? (similar to the way _serializer can be overriden)
def _dumper(obj):
return (i for i in obj)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in marshmallow/schema.py at the referenced lines where dump iteration is determined by list(), then compare the existing _serializer override behavior. Trace the surrounding dump flow and relevant tests. Done means callers can provide an object-to-iterator override while the current behavior remains unchanged by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100