Comment

Chris Nasr

This is actually less useful than the original. With this code only bools, integers, and floats would be checked, meaning any subclassing of int or float would not be caught.

Parent comment

Andrew Veitch

I would use: if type(value) is bool: elseif type(value) is int: elseif type(value) is float: which will work as expected.