From d2bab753687127c5194ab69232de957c80ada120 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Fri, 1 Feb 2019 00:09:06 -0700 Subject: [PATCH] Allow Number sub-classes to serialize None to colander.null This brings back behaviour that was intended to be included in #59 and commit 24f648dd14191dd348146267793d686792c63f8e but was accidentally reverted in 513d8600431a2680e3a1d781eafc0cc51243dafa. Closes #204 --- colander/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colander/__init__.py b/colander/__init__.py index 8bddfd6b..728eceba 100644 --- a/colander/__init__.py +++ b/colander/__init__.py @@ -1399,7 +1399,7 @@ class Number(SchemaType): num = None def serialize(self, node, appstruct): - if appstruct is null: + if appstruct in (null, None): return null try: