RFC: Remove Nested(many=True) to keep only the List(Nested()) form

Author: lafrechCreated Apr 19, 2018Updated Dec 1, 2025
Labelsfeedback welcomebackwards incompat

See discussion in https://github.com/marshmallow-code/marshmallow/issues/493#issuecomment-380468027.

We have two ways to do the same thing. They sometimes behave differently, which generally means one of them is buggy.

IMHO, and from what I have seen from users around me, it is more natural for a new user to write List(Nested) than Nested(many). Besides, it is consistent with Dict(values=Nested).

I realize this is quite a breaking change, both from user perspective, because Nested(many=True) is probably the most commonly used form, and from developer perspective, because it involves a lot of code changes (but also a lot of code removal, which is nice).

There could be things that can be done with Nested(many=True) but not with List(Nested), because in the former case, the nested Schema has access to the whole data, while in the latter, it is called on each element. Perhaps some pre_load edge cases might suffer from the change. Any real-life example, anyone?

Anyway, since the question was raised in a comment in another issue, I figured I'd give it more visibility.

Source: marshmallow-code/marshmallow