I don't know enough about Python, but couldn't we just check for unicode and long here? It seems like an int would be accepted if you're checking for a long.