marshmallow 4.2.1__tar.gz → 4.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {marshmallow-4.2.1 → marshmallow-4.2.2}/CHANGELOG.rst +8 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/PKG-INFO +1 -1
- {marshmallow-4.2.1 → marshmallow-4.2.2}/pyproject.toml +1 -1
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/fields.py +2 -2
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_deserialization.py +9 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/CONTRIBUTING.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/LICENSE +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/NOTICE +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/README.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/SECURITY.md +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/.gitignore +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/apple-touch-icon.png +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/custom.css +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/favicon.ico +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/marshmallow-logo-200.png +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/marshmallow-logo-with-title-for-dark-theme.png +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/marshmallow-logo-with-title.png +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/marshmallow-logo.png +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/api_reference.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/authors.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/changelog.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/code_of_conduct.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/conf.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/contributing.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/custom_fields.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/dashing.json +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/donate.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/examples/index.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/examples/inflection.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/examples/quotes_api.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/examples/validating_package_json.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/custom_error_handling.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/custom_error_messages.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/custom_options.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/index.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/overriding_attribute_access.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/pre_and_post_processing_methods.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/schema_validation.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/extending/using_original_input_data.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/index.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/install.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/kudos.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/license.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.class_registry.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.decorators.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.error_store.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.exceptions.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.experimental.context.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.fields.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.schema.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.types.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.utils.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/marshmallow.validate.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/nesting.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/quickstart.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/top_level.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/upgrading.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/whos_using.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/docs/why.rst +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/__init__.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/class_registry.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/constants.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/decorators.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/error_store.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/exceptions.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/experimental/__init__.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/experimental/context.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/orderedset.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/py.typed +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/schema.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/types.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/utils.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/src/marshmallow/validate.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/__init__.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/base.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/conftest.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/foo_serializer.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/mypy_test_cases/test_class_registry.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/mypy_test_cases/test_schema.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/mypy_test_cases/test_validation_error.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_context.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_decorators.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_error_store.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_exceptions.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_fields.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_options.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_registry.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_schema.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_serialization.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_utils.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tests/test_validate.py +0 -0
- {marshmallow-4.2.1 → marshmallow-4.2.2}/tox.ini +0 -0
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
4.2.2 (2026-02-04)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
Bug fixes:
|
|
8
|
+
|
|
9
|
+
- Fix behavior of ``fields.Contant(None)`` (:issue:`2868`).
|
|
10
|
+
Thanks :user:`T90REAL` for reporting and `emmanuel-ferdman` for the fix.
|
|
11
|
+
|
|
4
12
|
|
|
5
13
|
4.2.1 (2026-01-23)
|
|
6
14
|
------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: marshmallow
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.2
|
|
4
4
|
Summary: A lightweight library for converting complex datatypes to and from native Python datatypes.
|
|
5
5
|
Author-email: Steven Loria <oss@stevenloria.com>
|
|
6
6
|
Maintainer-email: Steven Loria <oss@stevenloria.com>, Jérôme Lafréchoux <jerome@jolimont.fr>, Jared Deckard <jared@shademaps.com>
|
|
@@ -2065,10 +2065,10 @@ class Constant(Field[_ContantT]):
|
|
|
2065
2065
|
_CHECK_ATTRIBUTE = False
|
|
2066
2066
|
|
|
2067
2067
|
def __init__(self, constant: _ContantT, **kwargs: Unpack[_BaseFieldKwargs]):
|
|
2068
|
+
kwargs["load_default"] = constant
|
|
2069
|
+
kwargs["dump_default"] = constant
|
|
2068
2070
|
super().__init__(**kwargs)
|
|
2069
2071
|
self.constant = constant
|
|
2070
|
-
self.load_default = constant
|
|
2071
|
-
self.dump_default = constant
|
|
2072
2072
|
|
|
2073
2073
|
def _serialize(self, value, *args, **kwargs) -> _ContantT:
|
|
2074
2074
|
return self.constant
|
|
@@ -1413,6 +1413,15 @@ class TestFieldDeserialization:
|
|
|
1413
1413
|
assert sch.load({})["foo"] == 42
|
|
1414
1414
|
assert sch.load({"foo": 24})["foo"] == 42
|
|
1415
1415
|
|
|
1416
|
+
def test_constant_none_allows_none_value(self):
|
|
1417
|
+
class MySchema(Schema):
|
|
1418
|
+
foo = fields.Constant(None)
|
|
1419
|
+
|
|
1420
|
+
sch = MySchema()
|
|
1421
|
+
assert sch.load({"foo": None})["foo"] is None
|
|
1422
|
+
assert sch.load({})["foo"] is None
|
|
1423
|
+
assert sch.load({"foo": "ignored"})["foo"] is None
|
|
1424
|
+
|
|
1416
1425
|
def test_field_deserialization_with_user_validator_function(self):
|
|
1417
1426
|
field = fields.String(validate=predicate(lambda s: s.lower() == "valid"))
|
|
1418
1427
|
assert field.deserialize("Valid") == "Valid"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{marshmallow-4.2.1 → marshmallow-4.2.2}/docs/_static/marshmallow-logo-with-title-for-dark-theme.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|