`str.isdigit` is better. `1.2` would pass here too, even though it's not an int (and so would `1e10`).