Strings and comments might have the same text format as another token (depending on the chosen color scheme). This confuse the is_string_or_comment functions. The solution is to set the text format object type to user object so that we can make the difference between e.g. a string and a number (which has the same format).

This should fix the python autoindent failing test cases