From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 260BA138A1A for ; Tue, 17 Feb 2015 19:58:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BA4AE083A; Tue, 17 Feb 2015 19:58:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0A32FE0804 for ; Tue, 17 Feb 2015 19:58:37 +0000 (UTC) Received: from big_daddy.dol-sen.ca (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 1E9CA33BF44 for ; Tue, 17 Feb 2015 19:58:37 +0000 (UTC) Date: Tue, 17 Feb 2015 11:58:34 -0800 From: Brian Dolbec To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH 2/2] Add profile-formats=build-id (bug 150031) Message-ID: <20150217115834.1afedca9.dolsen@gentoo.org> In-Reply-To: <54E39888.8060904@gentoo.org> References: <1424162233-25071-1-git-send-email-zmedico@gentoo.org> <1424162233-25071-2-git-send-email-zmedico@gentoo.org> <20150217105831.424731db.dolsen@gentoo.org> <54E39888.8060904@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: acbf9877-75c3-48ac-a5b3-b12b9b71abe4 X-Archives-Hash: 270f0f11e824e75bcf0cdca916008be3 On Tue, 17 Feb 2015 11:37:44 -0800 Zac Medico wrote: > On 02/17/2015 10:58 AM, Brian Dolbec wrote: > > > > class Atom() > > > > if allow_repo is None: > > allow_repo = True > > + if allow_build_id is None: > > + allow_build_id = True > > > > > > these can be written as > > allow_repo = allow_repo or True > > allow_build_id = allow_build_id or True > > Actually, your version behaves differently than mine for the case > where False has been passed in for these parameters. The parameters > are designed are provide a "smart" default, as long as the caller has > not passed in an explicit True or False value. yeah, I never thought of the possibility of them being passed in False. I just thought, hey, there is a shorter way of doing this. Usually I've done that for variables expecting lists, class instances, etc... -- Brian Dolbec