How to test if object is an integer?

Terry Reedy tjreedy at udel.edu
Fri Oct 14 21:27:26 EDT 2011


On 10/14/2011 9:05 PM, Chris Angelico wrote:
> 2011/10/15 惜悯<wauue at qq.com>:
>> retrun True if type(i) is int else False
>
> That tests if the object is already an int; the OP asked if a string
> contains an integer.

The misleading subject line did not. It should have been
"How to test if a string contains an integer?"

-- 
Terry Jan Reedy





More information about the Python-list mailing list