Commit 8568de9e authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

ht.TInt: Exclude boolean values

See inline comment.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 72729d6e
......@@ -74,7 +74,12 @@ def TInt(val):
"""Checks if the given value is an integer.
return isinstance(val, int)
# For backwards compatibility with older Python versions, boolean values are
# also integers and should be excluded in this test.
# >>> (isinstance(False, int), isinstance(True, int))
# (True, True)
return isinstance(val, int) and not isinstance(val, bool)
def TFloat(val):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment