Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: What behavior would you expect? Date: Thu, 19 Feb 2015 23:18:04 -0800 Organization: A noiseless patient Spider Lines: 7 Message-ID: <87mw49dpar.fsf@jester.gateway.pace.com> References: <87r3tlds2l.fsf@jester.gateway.pace.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="c694756f1077760bb5296aae16c74092"; logging-data="13148"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193QWUj15b2dCvjcGYjr0of" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:ed3fHxsNZMFBdqRKyXu20xgZkYE= sha1:FSgJ9xetBLURLpPJdu3g4nzbojk= Xref: csiph.com comp.lang.python:85955 Chris Angelico writes: >> if len(fs) == 0: ... # didn't get a filename > Bikeshedding: That could be written as simply "if not fs". :) Yeah, in that instance you could do that. It's an unsafe practice when None is used as the no-value marker, since the empty string is a perfectly good string and also converts to boolean false.