avoiding operations that result in python interanally raising an error