Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Bernardo Sulzbach Newsgroups: comp.lang.python Subject: Re: Using 'Or' Date: Sat, 16 Jan 2016 21:12:31 -0200 Lines: 16 Message-ID: References: <48smy.82436$Dn6.27537@fx46.am4> <569abbf3$0$1603$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de tJNo7/zfpo0ilUNSxVjInwAHD/rh/X7GGhR5mBGrZnfw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.033 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; '16,': 0.03; 'jan': 0.11; "'('": 0.16; "')'": 0.16; '2016': 0.16; 'agree.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'sat,': 0.23; 'header:In-Reply-To:1': 0.24; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'spaces': 0.29; 'code': 0.30; 'received:209.85.215.46': 0.30; 'received:google.com': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'hope': 0.61; 'default': 0.61; 'production': 0.67; 'bernardo': 0.84; 'subject:Using': 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=Hs5xZF5aVauq5Ikx8MT3xVnnE+G/c0KmeVMk6AjXZTI=; b=Z7WIRtWyI4uV1mQelynA7VdqU3/+rMl++ONZeAIbvZ7ElQ56Kxar0eFOWkHFKTmQcR eWv4w2XlYPUYkjCN47kOGPuujWgXkoOPQ890uipyzsMVErhLniBMC6Vo8BgCN9p7iGQS E5uOcZxvJmxtVbkMf9AdUF7xytcceCzejENf8NJHadeCUlUoCW3sqFnTTnjdRpOBCapP U0inNAYRFoWvTBFkWB0i396/bPL3siHoiADr2LUSV8kwqUrGgwE31a9aRMVpaCOAmUbP PxZrhTRzXOkyo8Zh4xBjnyP7DuSEliEW175ScxPrD8o7r3riZppLxVgOFb6opdeBEARZ XkFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=Hs5xZF5aVauq5Ikx8MT3xVnnE+G/c0KmeVMk6AjXZTI=; b=jw1Vs+lzEbGkFXNtd0mc6c/RjlW+6bpn+fxYgn2TwBGpgArMmqgc5CYDUDA++pxhNg MnajgFWlLZJQRnaD9XD//czBIuJKmhxnGfUE9hdIk6ojqincVRJp/iXkSjufo4P2EG2v e9qMo9OmkHuDMFUhuuhE3oGFJYNoXaYXjN0F9uACdrPQRmoZzwAkfXTzow8F6H+wt8a3 sB8gw0gLqtWQ9YsPP3HWeYRZ4xe57CkxYgT9fSiWMKc6Xa4jbEJPeymcj7yQYWxMwFBI XVnUsYkK3fSpg70VqLL+2JaoR17GQTIzs/Bz551sZ1zNgcsmdYXS3ASdumi8xvHmbqa6 E6fQ== X-Gm-Message-State: ALoCoQm5Y+UCHLpwfWf4pwzt9tZkawiKm2YPH7lZQnCCt0j6hgCR6G2s3IU/R/+rI4XM8D+FFjr8ugEN8QEbRA3fSzEC8kOCQQ== X-Received: by 10.25.153.79 with SMTP id b76mr5857862lfe.102.1452985990517; Sat, 16 Jan 2016 15:13:10 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101824 On Sat, Jan 16, 2016 at 8:47 PM, Alister wrote: >> >> default = "I like Brussels sprouts." >> message = random.choice(["", "I like boiled cabbage."]) >> print( message or default ) >> >> >> > I hope I never see production code like that > I agree. If you are going to use spaces after '(' and before ')' at least be consistent. -- Bernardo Sulzbach