Thomas Jollans <t...@jollybox.de> writes:

>>>>> def is_valid_password(password):
>>>>>     return mud.minpass <= len(password) <= mud.maxpass

> Which of the two comparisons is done first anyway?
> "In the face of ambiguity, refuse the temptation to guess."

There is no ambiguity. See the language reference:

"Formally, if a, b, c, ..., y, z are expressions and op1, op2, ..., opN
are comparison operators, then a op1 b op2 c ... y opN z is equivalent
to a op1 b and b op2 c and ... y opN z, except that each expression is
evaluated at most once."

The last restriction (single evaluation of involved expressions) makes
this a bit more than raw syntactic sugar.

-- Alain.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to