re-format with black

This commit is contained in:
giacomo 2022-04-27 17:14:12 +01:00 committed by Pavel Minaev
parent eb8095cbe6
commit 50632736bf

View file

@ -108,7 +108,11 @@ def of_type(*classinfo, **kwargs):
def validate(value):
if (optional and value == ()) or isinstance(value, classinfo):
return value
elif isinstance(value, str) and all(x in string.digits + '.' for x in value) and any(issubclass(x, numbers.Number) for x in classinfo):
elif (
isinstance(value, str)
and all(x in string.digits + "." for x in value)
and any(issubclass(x, numbers.Number) for x in classinfo)
):
try:
return int(value)
except ValueError: