On Thu, 10 Aug 2006 14:32:49 +0000 (GMT)
John Salerno <[EMAIL PROTECTED]> wrote:
#> Bruno Desthuilliers wrote:
#>
#> > try:
#> > if int(text) <= 0: raise ValueError
#>
#> Hmm, I'm actually not so sure about this line now. It doesn't seem right
#> to raise a ValueError when the result of the expression is negative,
#> because even though it's a problem for my program, it isn't really a
#> "ValueError," right?
Well, you could always do something like
try:
int("-"+text)
Now, this *will* be a real ValueError for negative integers ;-) ;-) ;-)
But no, I am not suggesting that... especially since "-0" is valid.
--
Best wishes,
Slawomir Nowaczyk
( [EMAIL PROTECTED] )
COMMAND: A suggestion made to a computer.
--
http://mail.python.org/mailman/listinfo/python-list