Skip to content

Coerce on List elements produces unexpect results #161

@proximous

Description

@proximous

Slight modification of the example at: http://cerberus.readthedocs.org/en/latest/usage.html

schema = {'a_list': {'type': 'list', 'schema': {'type': 'float', 'coerce': float}}}
document = {'a_list': [3, 4, 5]}
v.validated(document, schema)
>>> {0: 3.0, 1: 4.0, 2: 5.0, 'a_list': [3, 4, 5]}

I would expect:

>>> {'a_list': [3.0, 4.0, 5.0]}

Is this the intended behavior or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions