[Tutor] Re: Question on Regular Expression Help
alan.gauld@bt.com
alan.gauld@bt.com
Mon Feb 10 13:30:09 2003
> Don Arnold wrote:
> > >>> def isInt(aString):
> > try:
> > int(aString)
> > return True
> > except:
> > return False
>
> But note that int(3.14) => 3 ! Is that what you want? Is 3.14 an integer?
>
Oops, I didn't notice it was Don who shifted the target from numbers
to integers. In that case my earlier reasoning was wrong. However as
he says it does work, just not for the reasons I gave!
Alan G.