From nobody Sat Jul 5 15:54:49 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 1521296745150392.7280670663298; Sat, 17 Mar 2018 07:25:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0E9168115; Sat, 17 Mar 2018 14:25:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B68AA5D75E; Sat, 17 Mar 2018 14:25:43 +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 781A54CAA1; Sat, 17 Mar 2018 14:25:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2HEO3JD000605 for ; Sat, 17 Mar 2018 10:24:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id CC18E7EE14; Sat, 17 Mar 2018 14:24:03 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C14B87EE20 for ; Sat, 17 Mar 2018 14:24:03 +0000 (UTC) Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) (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 6E1B319CBC4 for ; Sat, 17 Mar 2018 14:24:02 +0000 (UTC) Received: by mail-wr0-f180.google.com with SMTP id l8so14303936wrg.5 for ; Sat, 17 Mar 2018 07:24:02 -0700 (PDT) Received: from rst.Home ([2a02:c7d:692a:c500:1ebc:73f3:5f60:b131]) by smtp.gmail.com with ESMTPSA id i66sm11060550wmd.0.2018.03.17.07.23.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Mar 2018 07:24:00 -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=6hyE9h1m9QdpOL1rLbHSi9numiFur7AV5hwmTCQJxbg=; b=FWc2vcw4vsPpWhx7v6UkLYFHHYI3VM2ndyeRlrKfQiFQNdwt4AM1FrrNFZpZoJ8OJj VBaJahxkdTWfWMmIf3vv2WC5f1HkruvAG4ZPH2N8YlFvAK4uLx+lyfB6pPi92TLZoaZf PNhC9RUCztXbbzlNQY8taPxc73WBVNDBsZljyuWDgON6DFCS2LMeaU5pj0ETJ0Fv20T8 7JA4xhMTMZy4MFIpGWiyI9idOpRkw58V/1ZFXSG3qebtjQ0BWTKgyMThL3mYwEn1WH1A i8r1UwCQf2oVip8XO2/XuyTHZZy8J06casJYas8b+QnFCI5Zp/rTnDWdqy90SvwykJ5l cAOw== 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=6hyE9h1m9QdpOL1rLbHSi9numiFur7AV5hwmTCQJxbg=; b=IpxQR2Vy3p1/5vH2cL5sBtFNBglmtvqxRxhEvNXQ6YZ/2HWBPu/ZPUQSW1rtUIlevL DLUHhjY9rtXmR4M3PylpddDrOiHxvxL4SDf6euuUI+Gds8OfLRTx/+MZnMteE3TJ9f1S YyrybO5NNru+JHRdoIShv9MG7GDIjAPNxn+ApdP7sJZTjAYIu6H7/O2mttS9WJW6I4Im JIsKOqdDDXXoE/5G3rgnb1OFOFfdmqXn0IJ/3JO7GzCb+YAZ4WE4VozMqtUDvRJbTtNn W3lofABdQrUZKg8/686NCjY2xx2250dkd4GtlT5tN36o/9u63yekD3/QUl0HrX5ZZcxM W/bw== X-Gm-Message-State: AElRT7FopRIjV/vNXbHj2qROdmoDgMHN7J8sTKYF75KhyYliNbBOKxtG ZiZMTR44KzSXY4Da0ic9priI1UAy X-Google-Smtp-Source: AG47ELv6ml4TaIjEC/ywzy09gi6VoEItaC9+vk2udWgerjPudOamNiDdc2SIUcl/bo4HmgiBOLtDJQ== X-Received: by 10.223.160.42 with SMTP id k39mr4950782wrk.138.1521296640881; Sat, 17 Mar 2018 07:24:00 -0700 (PDT) From: Radostin Stoyanov To: libvir-list@redhat.com Date: Sat, 17 Mar 2018 14:23:30 +0000 Message-Id: <20180317142340.11653-13-rstoyanov1@gmail.com> In-Reply-To: <20180317142340.11653-1-rstoyanov1@gmail.com> References: <20180317142340.11653-1-rstoyanov1@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 17 Mar 2018 14:24:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 17 Mar 2018 14:24:02 +0000 (UTC) for IP:'209.85.128.180' DOMAIN:'mail-wr0-f180.google.com' HELO:'mail-wr0-f180.google.com' FROM:'rstoyanov1@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.139 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.128.180 mail-wr0-f180.google.com 209.85.128.180 mail-wr0-f180.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Radostin Stoyanov Subject: [libvirt] [PATCH 12/22] 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 17 Mar 2018 14:25:44 +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 Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/apibuild.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 8fecf5a81..149cd41cc 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