From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by gnuweeb.org (Postfix) with ESMTPSA id DACA481892 for ; Tue, 20 Dec 2022 00:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1671496451; bh=IwJudGFYLB2myC2mQpMfys7vV5xlOibzW5kOjh/9rus=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dxDVe2segpGRrOKMek5j3v7fS1EPfxBQGp3QNcOt2V79WOJd18dIWLIUNmzqlU6Az qzRY3gvxbgsm3eccg887E1XKetMagHHsHfvAmnYkw2FC4q5y+XVXFDNPVPEOOhsDPf Qn3h3EfqvxtaSHN205JjVTvksP9AYB7W7JribGjDrixCUDryXbfxhHLEydVahKFt2Z YHQn+o3ZsT7y6H7kNpKRY/uhYxdbocELr5GpjTqpmEMVFGBeBc8qOsviXPKukwYM/k YLzo4QUZuWstAVlwRkLNuoxKyL4/Xun/EdcPZTKvUvfQSeC9kykzwv2Lsn8qmoRD4d Y/weJemYTi+KA== Received: by mail-lf1-f46.google.com with SMTP id m29so16023280lfo.11 for ; Mon, 19 Dec 2022 16:34:11 -0800 (PST) X-Gm-Message-State: ANoB5pmPlStRQi+63GljdzCCSiZ8+csDout1Ev9/R+IoT1bvGQEijoao 6urAmbMlxe1iJ6RH9a4j5ZRf8WTfvxenpSaeq5k= X-Google-Smtp-Source: AA0mqf79fQyKPz4pRRNSKt5qYViNZf1OV+x5PmIgZY5Wd15jMj6m1q0dv/PFpucXInhuzjg5UTN4CGqAA1+CU+/OCHI= X-Received: by 2002:ac2:4189:0:b0:4b1:2447:6971 with SMTP id z9-20020ac24189000000b004b124476971mr28252511lfh.83.1671496450051; Mon, 19 Dec 2022 16:34:10 -0800 (PST) MIME-Version: 1.0 References: <20221219235721.126-1-kiizuha@gnuweeb.org> <20221219235721.126-5-kiizuha@gnuweeb.org> In-Reply-To: <20221219235721.126-5-kiizuha@gnuweeb.org> From: Alviro Iskandar Setiawan Date: Tue, 20 Dec 2022 07:33:58 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 04/17] fix: utils: Fix the extract_list() utility function To: Muhammad Rizki Cc: Ammar Faizi , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" List-Id: On Tue, Dec 20, 2022 at 6:57 AM Muhammad Rizki wrote: > +def extract_list(key: str, thread: Message): > + try: > + people = thread.get(key.lower()) > + if not people: > + return [] > + except: > return [] > return __extract_list(people) Why does this have to be a "try and except"? And not something like: k = key.lower() if k in thread: return __extract_list(people) return []