Dont use value for determining any type

otherwise Falsy values are not valid types
This commit is contained in:
Ben Howes 2018-12-11 14:49:13 +00:00 committed by GitHub
parent db5d825395
commit 3d2926871b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ class Schema(object):
}
TYPE_VALIDATOR_CALLABLE_GETTER = {
SchemaType.ANY: lambda x: x,
SchemaType.ANY: lambda x: True,
SchemaType.BOOLEAN: TypeValidator(bool),
SchemaType.INTEGER: TypeValidator(integer_types, exclude=bool),
SchemaType.NUMBER: TypeValidator(integer_types, float, exclude=bool),