From e916ab4db88ea6a76a34bd91c8290073191b176b Mon Sep 17 00:00:00 2001 From: Exa Date: Sat, 25 Aug 2018 09:53:00 +0300 Subject: [PATCH] Removed ITERABLE type validating. There's no need to automatically type check ITERABLE flavours when this can be done by the user. The reason this is needed is because, for example, the default JSON encoder accepts both tuples and lists as array types. Creating a schema with either of them will result in the validation failing if the other is passed instead. --- schema.py | 1 - 1 file changed, 1 deletion(-) diff --git a/schema.py b/schema.py index a8fc24e..0362b9e 100644 --- a/schema.py +++ b/schema.py @@ -249,7 +249,6 @@ def validate(self, data): i = self._ignore_extra_keys flavor = _priority(s) if flavor == ITERABLE: - data = Schema(type(s), error=e).validate(data) o = Or(*s, error=e, schema=Schema, ignore_extra_keys=i) return type(data)(o.validate(d) for d in data) if flavor == DICT: