Volker Grabsch a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> schrieb: > >>PTY wrote: >> >>>I was asking whether it was better style to >>>use len() or not. >> >>FWIW, it's also more generic (you could have an object supporting >>pop() but not __len__()), less error-prone, > > > While I agree with all other points, I don't think that it's less > error-prone.
There are less risk of a typo with "if a:" than with "if len(a) > 0". > See my other posting where I worked out this a flaw > of Python. See my answer where I don't agree on this being a "flaw" - a "minor wart" at most !-) -- http://mail.python.org/mailman/listinfo/python-list