Skip to content

Booleans are accepted for type integer #144

Description

@mbalser

Internally cerberus 0.10 does the following:

>>> isinstance(1, (int,))
True
>>> isinstance(True, (int,))
True
>>> isinstance(0, (int,))
True
>>> isinstance(False, (int,))
True

Of course I could map True and False to integers using Value Coercion, but this seems awkward and feels it is not the correct thing to do when using a type check for integers and not explicitly for booleans.

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