From 0c3092e572572f21c834c03768411fde215baeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lafr=C3=A9choux?= Date: Wed, 1 Jan 2025 22:08:11 +0100 Subject: [PATCH] Fix Function field docstring about context --- src/marshmallow/fields.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py index 65c1abf5a..d84280e34 100644 --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -1900,13 +1900,13 @@ class Function(Field): :param serialize: A callable from which to retrieve the value. The function must take a single argument ``obj`` which is the object to be serialized. It can also optionally take a ``context`` argument, - which is a dictionary of context variables passed to the serializer. + which is the value of the current context returned by Context.get(). If no callable is provided then the ```load_only``` flag will be set to True. :param deserialize: A callable from which to retrieve the value. The function must take a single argument ``value`` which is the value to be deserialized. It can also optionally take a ``context`` argument, - which is a dictionary of context variables passed to the deserializer. + which is the value of the current context returned by Context.get(). If no callable is provided then ```value``` will be passed through unchanged.