On Sun, Feb 26, 2012 at 10:56 PM, Wolfgang Meiners
<wolfgangmeiner...@web.de> wrote:
> That means:
> if maxlength and (len(string) <= maxlength):
>
> is equivalent to
> if (maxlength is not None) and (len(string) <= maxlength):

On the contrary, it means they are distinctly NOT equivalent. The
shorter form would treat a maximum length of 0 as meaning "unlimited".
Now, that's an understandable notation, but it's not what's given
here; if None means unlimited, then 0 should enforce that string ==
"".

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

Reply via email to