theoretically this would be a good time for an "elif", or swap the positions of this "if" block with the one at line 122. I assume if we determine it's a basestring, we don't need to also test if it's a bool. this is obviously a very minor suggestion.