Re: strange test for None

2007-02-03 Thread karoly.kiripolszky
the tested variable was really a string containing "None" instead of simply None. this is the first time i ran into this error message confusion. :) thanks for the help! On Feb 3, 6:29 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Feb 3, 2007, at 7:47 AM, karoly.kiripolszky wrote: > > > in

Re: strange test for None

2007-02-03 Thread Michael Bentley
On Feb 3, 2007, at 7:47 AM, karoly.kiripolszky wrote: > in my server i use the following piece of code: > > ims = self.headers["if-modified-since"] > if ims != None: > t = int(ims) > > and i'm always getting the following error: > > t = int(ims) > Value

Re: strange test for None

2007-02-03 Thread rzed
"karoly.kiripolszky" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > in my server i use the following piece of code: > > ims = self.headers["if-modified-since"] > if ims != None: > t = int(ims) > > and i'm always getting the following error: > >

Re: strange test for None

2007-02-03 Thread Peter Otten
karoly.kiripolszky wrote: > in my server i use the following piece of code: > > ims = self.headers["if-modified-since"] > if ims != None: > t = int(ims) > > and i'm always getting the following error: > > t = int(ims) > ValueError: invalid literal for

Re: strange test for None

2007-02-03 Thread skip
> "karoly" == karoly kiripolszky writes: karoly> in my server i use the following piece of code: karoly> ims = self.headers["if-modified-since"] karoly> if ims != None: karoly> t = int(ims) karoly> and i'm always getting the followi

Re: strange test for None

2007-02-03 Thread karoly.kiripolszky
forgot to mention my interpreter version: 2.4.4 -- http://mail.python.org/mailman/listinfo/python-list

strange test for None

2007-02-03 Thread karoly.kiripolszky
in my server i use the following piece of code: ims = self.headers["if-modified-since"] if ims != None: t = int(ims) and i'm always getting the following error: t = int(ims) ValueError: invalid literal for int(): None i wanna know what the hell is goi

strange test for None

2007-02-03 Thread karoly.kiripolszky
in my server i use the following piece of code: ims = self.headers["if-modified-since"] if ims != None: t = int(ims) and i'm always getting the following error: t = int(ims) ValueError: invalid literal for int(): None i wanna know what the hell is goi

Re: test for None

2006-04-18 Thread BartlebyScrivener
>> Have you followed the tutorial through, running and understanding each >> example, to get the basics of Python covered? Could be high time to try that again. At first it was way too much, so I've been doing Dive Into Python and some others. But I will try the Tutorial again, at least up to clas

Re: test for None

2006-04-18 Thread Ben Finney
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > How do you test for a function that returns nothing, A function returns a single value (which may be a container for other values). By default, with no 'return' statement, it returns the None object. What is it you're trying to do? > and why doe

Re: test for None

2006-04-18 Thread BartlebyScrivener
I think I was trying for something like this, where the intervening for iterates over a function that may or may not produce nothing: x = None for x in []: print x if x is None: print "x is still none because nothing happened" Thanks, rick -- http://m

Re: test for None

2006-04-18 Thread Erik Max Francis
BartlebyScrivener wrote: > How do you test for a function that returns nothing, and why doesn't > this work? Shouldn't X have to be either None or not? > x = None for x in []: > ... if x is None: > ... print "X is None" > ... else: > ... print "X is not None" > ..

test for None

2006-04-18 Thread BartlebyScrivener
How do you test for a function that returns nothing, and why doesn't this work? Shouldn't X have to be either None or not? >>>x = None >>> for x in []: ... if x is None: ... print "X is None" ... else: ... print "X is not None" ... Thanks, rick -- h