From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6C99AA04F0; Tue, 10 Dec 2019 14:33:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 94C6237A2; Tue, 10 Dec 2019 14:33:32 +0100 (CET) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 7F68A23D for ; Tue, 10 Dec 2019 14:33:31 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id n9so3241220wmd.3 for ; Tue, 10 Dec 2019 05:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hgxrMGJ/Ax8bF9r8jOjGJ9qKa7JNSTHkSalC6KxdjO4=; b=TdeOZBZFeuhwEAMbxdOLmPZWmgu9aexkoDKiiyHLak1YwSsScuoRkGRBekI9OriGYz 9lIn2FeJiylc99SAHyPNXpjvlRs/0b2TePC31+RUkQuaFMToD3STTad9v7JUWrKKenEt o45z+g8SbxaUiE9No8NB3Hy82DLuBNkEkR89Uz4V7hHLilKd7KbAVpwyVBwJy9ct+iLR /bqj/1wIOsyLZQvtGzwO5B/fxLdxGiCobmuVNC12Kz1feo50ut5H5pXDpyjKtjJB7wJa qe0aloO4gHRKmsEfo9vZDlPy6XuYOh0oNQX58M1f+ikJ8PC5lmC5sXqyiGzaGCHG5eZ7 o+hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hgxrMGJ/Ax8bF9r8jOjGJ9qKa7JNSTHkSalC6KxdjO4=; b=PBxHD0x00boHqdWsTu+ds8kLQqjccc64eEMm5wyU29sl5FCv6DHuwvNgyF3pTyhQGO lyLV+CxkgKmvoO29l2VQ17yxzSNl0uIbiUOemC8h88NFn3YJhQgodv8cp/BT2yY4VF/s d6qqd/1L9JR6oySyxwoj4r0GagVlevbCWGesLa+Srf2SrdkbWvr/9kXJtn/EA165+tuj au4dATjbvTJO45u+s2ZPId4HOpaGiPXLSN2yswYaYXyZ/G/GaHTbMxrhNuXWwP5J1MKs 4i/RJeBGuUM7JrIjdfjPYAtiUNFbAUrdM8OlxZU/IHAUVzNpXw1TaIbtb+gxf03ntGr6 T7BQ== X-Gm-Message-State: APjAAAWfrPYrwvegPa9/X8FOsjXDyRcFhh4+vZz+u8OCEEOO6b/qQcGv KR6gPexdrysXEbAA4zibk7n+zw== X-Google-Smtp-Source: APXvYqxYRMDa0GUo4rh0YtHJjetp6cakQNyZL9XDljtim8czKfLeFutcky5hOCdNujOpAlmgMcKNgA== X-Received: by 2002:a7b:c85a:: with SMTP id c26mr5246019wml.107.1575984811194; Tue, 10 Dec 2019 05:33:31 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id d8sm3234060wre.13.2019.12.10.05.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 05:33:30 -0800 (PST) Date: Tue, 10 Dec 2019 14:33:29 +0100 From: Robin Jarry To: Thomas Monjalon Cc: Bruce Richardson , John McNamara , Marko Kovacevic , dev@dpdk.org Message-ID: <20191210133329.53mejxbyz4m5v7gr@6wind.com> References: <20191209210000.906000-1-thomas@monjalon.net> <20191210120023.GA103@bricha3-MOBL.ger.corp.intel.com> <3025741.7YuKWOzX4Z@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3025741.7YuKWOzX4Z@xps> User-Agent: NeoMutt/20180716 Subject: Re: [dpdk-dev] [PATCH] doc: fix build with python 3.8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2019-12-10, Thomas Monjalon: > 10/12/2019 13:00, Bruce Richardson: > > On Mon, Dec 09, 2019 at 10:00:00PM +0100, Thomas Monjalon wrote: > > > After upgrading to python-3.8.0, a syntax mismatch is revealed: > > > > > > doc/guides/conf.py:240: SyntaxWarning: "is not" with a literal. > > > Did you mean "!="? > > > if value is not '': > > > > > > Replacing "is not" with "!=" seems the right thing to do. > > > > > > > Since this is basically just checking for an empty string is > > "len(value) > 0" not more logical than either comparison against ''? > > Probably yes. > I don't know what is the best practice in Python. Robin, any clue? In most cases, it is shorter and cleaner to simply do: if value: which behind the scenes calls value.__bool__() (or value.__len__()). https://docs.python.org/3/reference/datamodel.html#object.__bool__ -- Robin