On Mon, Mar 8, 2010 at 1:31 PM, Branko Vukelic <[email protected]> wrote:
> What is bad about it?
>

The "problem" is that you could just return session.login, which will
evaluate as True for any non-zero number, rather than testing if it is
equal to 1, and then returning True.

True/False in Python are more-or-less numeric values 1/0.

>>> True + True
2
>>> True / False
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ZeroDivisionError: integer division or modulo by zero

... All I am saying is, at least it wasnt:

if condition == True:
    # do true stuff
elif condition == False:
    # do false stuff

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to