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=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by gnuweeb.org (Postfix) with ESMTPS id DA18681892 for ; Tue, 20 Dec 2022 01:56:43 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=meN696L6; dkim-atps=neutral Received: by mail-pg1-f174.google.com with SMTP id f9so7409208pgf.7 for ; Mon, 19 Dec 2022 17:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=RbUPf7hezFiDaBfxDoGOdF+nhs0TVm/BXxIR/bTx0Sw=; b=meN696L6/p4mgH/d2hFITF5mlts1VfT5ajVqAk7c+8cooo8RT/stB6XZGAb+NXRkth znDxRo54QOFKFpd+Ij3DZt1zGMFH9N0tsp6u1CMer9J0s5g/35HtQXl0m7RLdT8YEO1r FLaUnLEVb8u/dB1r65RNnmGIf/y/i6/oIB4Nixe9rZ8th2Sy89uZcMnXjRguIzpY2vBT TSeI5kUSBEHUKZvhx9AZktwKa7msQQRTuGfAb0f+AOUALwO5Iq5qMeV71KOsaxmZJiel tNiYHNr4lPMrbetAYN1VUuWzyL6Rcb+24L8nixl7bPQylSjDJtX+plwXmTtk734SEsUw P23g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RbUPf7hezFiDaBfxDoGOdF+nhs0TVm/BXxIR/bTx0Sw=; b=JiZxnKI0XrhJnAtzAtRv1UvxJ4JPbMjk1Qx8kT+auQpvFq43nD4XuGkpE1hTpuvsLS 8xrkugHN0+BQJrnjFhKD7XFaXgHiD+KYij9eaZyKjOGXpRLz+HGYV5e5HroI4CeYnAZ1 brL/nNKYy1Uau7VIk2kCf672R4cWNwVZ6s050knD7OQXlpxRqIje0+Tg6LBkL60JIWB5 /xK4cEjI+A9pkIBv5SI+HPqw9sCHCV3w4uV66Xr8tKi1TGtMzvWWBbmSLJW4JANhmbob X7cQTw04OOp9lYiKawizWxTvHlcBWT1LlJTx7Kqo0WBBzQ10PhJ04cnhwrQk3VbcjeCV bxfg== X-Gm-Message-State: ANoB5pmwyo4VjU/QW4ACliR38CayPY2b/b2U2ehQ5QE8PEfFWSLfk6ap tkduj3EwM2zfqO8g5jSBKD2F5xytq3KTBw== X-Google-Smtp-Source: AA0mqf6imsDmTn4ouE7B9CbnFEZVlRzXb6dezRR5cJj6atsnPU/4fFlSJ3EDCahBVHCkULMVj+jgkQ== X-Received: by 2002:a05:6a00:4003:b0:575:d2cf:1142 with SMTP id by3-20020a056a00400300b00575d2cf1142mr43360317pfb.13.1671501403286; Mon, 19 Dec 2022 17:56:43 -0800 (PST) Received: from [192.168.1.2] ([101.128.125.209]) by smtp.gmail.com with ESMTPSA id y184-20020a6264c1000000b00576d4d69909sm7345964pfb.8.2022.12.19.17.56.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Dec 2022 17:56:42 -0800 (PST) Message-ID: Date: Tue, 20 Dec 2022 08:56:36 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v3 04/17] fix: utils: Fix the extract_list() utility function Content-Language: en-US To: Alviro Iskandar Setiawan , Ammar Faizi Cc: Muhammad Rizki , GNU/Weeb Mailing List References: <20221219235721.126-1-kiizuha@gnuweeb.org> <20221219235721.126-5-kiizuha@gnuweeb.org> From: Kiizuha In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 20/12/2022 08.15, Alviro Iskandar Setiawan wrote: > On Tue, Dec 20, 2022 at 7:45 AM Ammar Faizi wrote: >> I don't know much about Python, but doesn't that only >> work for dict? Or it can use `in` operator too? >> >> `thread` is an instance of Message class object here. > > oh ic ic, it doesn't work for the normal class, for ex: > > class X(): > a = 1 > b = 2 > > x = X() > print("a" in x) > > this error: > TypeError: argument of type 'X' is not iterable > > if the Message object is iterable, maybe it can use the "in" operator > just like dict and array, but I don't know. Rizki? Like in the library code, the Message class has a __str__(self) method. def __str__(self): """Return the entire formatted message as a string. """ return self.as_string() If we use it like `str(thread)` it will return a full email content.