From nobody Sat Jul 5 16:21:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521528611602435.2152173727088; Mon, 19 Mar 2018 23:50:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4BEC0356DC; Tue, 20 Mar 2018 06:50:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 22AC018949; Tue, 20 Mar 2018 06:50:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D8438181BA06; Tue, 20 Mar 2018 06:50:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2K6nhSB019489 for ; Tue, 20 Mar 2018 02:49:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id A9918D1E8; Tue, 20 Mar 2018 06:49:43 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A4C2CD1E4 for ; Tue, 20 Mar 2018 06:49:43 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9DF580F6C for ; Tue, 20 Mar 2018 06:49:42 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id h76so1194989wme.4 for ; Mon, 19 Mar 2018 23:49:42 -0700 (PDT) Received: from rst.Home ([2a02:c7d:692a:c500:1ebc:73f3:5f60:b131]) by smtp.gmail.com with ESMTPSA id g38sm1923269wra.77.2018.03.19.23.49.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Mar 2018 23:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OmSu/QO63Y+3hWAF5SFeLbUzTMB6CrTQW5lYVONENvk=; b=JPcCwvkMJSqoI87vn86gGUE7tYS6T+jpCHNLUlUpjK0rgBqzmNi6rxYvSz0TPklnM4 rGoz7tOnWJf8d5IqieU+c7O+g4Jk8wvA7GE7BT9vbb823cFS1LyQ1fm8Iznoteq2AfH0 0cFZVPAZwcr0+Byo0xGWEXu2xl5QG+XMSn3xmkvmtHCezT1Wf1m/622azPRp7iHgt4HF dSWwUiRtd5xjrIqEOwWCgfq4+ajjih4PiziwJkQpasf0O4UVYqTJ89ChcJrq5AukpRlM SUCbKNLK9xiqNou9Gh50I3WLNte7bQAeZzI1DNlYH0c25Q8fDAiEGhR46fG+I1I1wnyd dDsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OmSu/QO63Y+3hWAF5SFeLbUzTMB6CrTQW5lYVONENvk=; b=nzzpW+9QPh8iRKgewnqvmy4rMAC7HTeC/RvmbuNM854khoK0UF7Yba/cKbqh/upL2p zib3vAe+jBgtJZL7xERraxEbI3XfrL4I6UhCmx0r5F4cO04Mf4A6QumLR4EuW7pQn+M/ YR13lJvfREH6FFyRYgxbxJkAH0urXipbF2BGr26nf7CL2s082gYKAlogTdMqNzAT9vea c5tcNxpUsC4arVihPbujZ/6k10HornSpeK2ZeA5+pgjRY4I71Qz/zGmVoERNOB6FHQgi ne4r4PRhk3ezFYJYt/59EiKfMylN6e5r1FhpLVqVYbn2ZvymctewQbOov/I5etUEpx5M zDlw== X-Gm-Message-State: AElRT7HwuP0JiW89L6dDAzV9OrnbROdKddZ1EHtZy8HKqj9sq4G5w530 ErHrn4mOISXCqbyMY2mU+WffhJgW X-Google-Smtp-Source: AG47ELtdpJJrhPIG7jcII7py15PI9aRctg0aj1fRA4ok9tvdEYxFIsLJyWcRSAxwBchjnzfF6DEx1A== X-Received: by 10.28.8.143 with SMTP id 137mr1025735wmi.54.1521528581111; Mon, 19 Mar 2018 23:49:41 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Tue, 20 Mar 2018 06:48:56 +0000 Message-Id: <20180320064908.17723-14-rstoyanov1@gmail.com> In-Reply-To: <20180320064908.17723-1-rstoyanov1@gmail.com> References: <20180320064908.17723-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:49:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 20 Mar 2018 06:49:42 +0000 (UTC) for IP:'74.125.82.43' DOMAIN:'mail-wm0-f43.google.com' HELO:'mail-wm0-f43.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.12 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.82.43 mail-wm0-f43.google.com 74.125.82.43 mail-wm0-f43.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCHv2 13/25] apibuild: Simplify uniq function X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Mar 2018 06:50:10 +0000 (UTC) X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use a set (unordered collections of unique elements) [1] to remove repeated elements in a list. 1: https://docs.python.org/3/tutorial/datastructures.html#sets Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 50ddf372d..1619c8836 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -130,11 +130,7 @@ def escape(raw): return raw =20 def uniq(items): - d =3D {} - for item in items: - d[item] =3D 1 - k =3D sorted(d.keys()) - return k + return sorted(set(items)) =20 class identifier: def __init__(self, name, header=3DNone, module=3DNone, type=3DNone, li= neno=3D0, --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list