Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.045 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'test,': 0.05; 'false.': 0.07; '"if': 0.09; 'semantics': 0.09; 'subject:while': 0.09; '11:19': 0.16; 'wrote:': 0.17; '15,': 0.23; 'header:In-Reply- To:1': 0.25; 'am,': 0.27; 'implemented': 0.27; 'andrew': 0.27; 'message-id:@mail.gmail.com': 0.27; 'run': 0.28; 'could': 0.32; 'skip:l 40': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'but': 0.36; 'test': 0.36; 'option': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'evaluate': 0.62; 'ever': 0.63; 'jul': 0.65; 'miss': 0.75; '(is': 0.84; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=O4I6/+NChViKfspnFpcyplVEI+IYLHIVYbIPUccSglQ=; b=MGc0F617wR7EW7l3dzo4p613XPkvikFaLzbPm0unzhILXdpgY4dDoXiR/cN/HK4BfA OnveNL3e+P9jtdzYOkzkH9GiisZCprNnQTp2WvlC16jPU17nMv96D7H5omDlFay4uREw HNmf0EeEFs1u2dxzb+lEoC+6jCGml+MUKifdqY5t67j4G1Hj8iypJp5QfXC5d1pbKfPI fzw0OYKqZcumfpooZ/PRTbKC8gISNU3lyTAlWjbhxrbmBwjy9odt983Ba1HaRynVEkZo DucjOnYI3OtftrBbKsDqhp8XdVDI3tCfXHLRMkr/XWZy4fzB4DulSL/DbsnqCoE6zG+j krcQ== MIME-Version: 1.0 In-Reply-To: <5002FAD0.8040701@gmail.com> References: <5002a1f9$0$29995$c3e8da3$5496439d@news.astraweb.com> <5002FAD0.8040701@gmail.com> From: Ian Kelly Date: Sun, 15 Jul 2012 11:45:10 -0600 Subject: Re: Implicit conversion to boolean in if and while statements To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1342374343 news.xs4all.nl 6875 [2001:888:2000:d::a6]:42240 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25362 On Sun, Jul 15, 2012 at 11:16 AM, Andrew Berg wrote: > On 7/15/2012 11:19 AM, Ian Kelly wrote: >> Ugh, that's irritating. I can't think of any scenario where I would >> ever want the semantics "if timeval (is not midnight):". > It's not implemented with such a test, but > logging.handlers.TimedRotatingFileHandler has an option to rollover at > midnight. Nor could it be implemented with such a test, since the rollover check would then have to run at exactly midnight for the test to evaluate false. If it were off by 1 microsecond, it would miss it.