Skip to content

Number cannot serialize None and Datetime serializes None to colander.null #186

@ny2ko

Description

@ny2ko

I would like to know why Int (Number generally) cannot deserialize None i.e. serialize None to None. This used to be the case in previous versions of colander but it seems to have been removed. Instead now it fails on the call to int(None). Was there a reason for this design change?

Also DateTime serializes None to colander.null. This has been changed for most other types to only serialized colander.null to colander.null by:

def serialize(self, node, appstruct):
        if appstruct is null:
            return null

Is there a reason why DateTime is any different?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions