PyWart: Language missing maximum constant of numeric types!

Wolfgang Meiners WolfgangMeiners01 at web.de
Sun Feb 26 08:32:51 EST 2012


Am 26.02.12 13:52, schrieb Chris Angelico:
> On Sun, Feb 26, 2012 at 10:56 PM, Wolfgang Meiners
> <WolfgangMeiners01 at 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

You are right. It seems I did not get the line
    zero of any numeric type, for example, 0, 0L, 0.0, 0j.
right.

Wolfgang



More information about the Python-list mailing list