It is impossible to do this perfectly! Consider two strings that consist of the same digits and different trailing whitespace. As numbers, they are equal. As strings, they are not. There is no way to tell (from the data alone) which is intended. Coercing everything to strings suppresses the "nastygrams" and is correct for all but a few special cases.