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.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.2] (unknown [101.128.125.123]) by gnuweeb.org (Postfix) with ESMTPSA id 214C9804D1; Thu, 20 Oct 2022 04:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666239890; bh=guRTl/8VABJzA7i8QCkXkg4qa/3/rr0k8UVF+aLh+FE=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=qiTUHv/7fRahKt/TYzgwZGMM80srbIXi0UJC5q1BQb6ucrGBIP853j9D2pady4XwZ Z6j+Z3FGpTUF6q/QMeK5hKAuYxYDiQ9rFfywOFRMPikn4c3+MvfhvRglYF+0VI2Oys 2ykoq4HR5PWTitG2G7gUoVlo3NHV8T8iRwnbDv37nSC2j5Sk5rxMC4gmZ3QJUlLOZv 6X2JG7o8zhUwBqjzKbcKHcmmZ8oQhf6kKO/c233uDG6C5g7odnhfJDOtD0YY5JLo6l cCATSHK+tSPiIpkAEympxSBOuFYkecBnUEFU/a4o5p0bopzMDWB4MN2D4ceGHW5wta MZqkiedNxAMsQ== Message-ID: Date: Thu, 20 Oct 2022 11:24:45 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v1 4/7] atom: Improve fix_utf8_char() Content-Language: en-US To: Alviro Iskandar Setiawan Cc: Ammar Faizi , GNU/Weeb Mailing List References: <20221018081635.1617-1-kiizuha@gnuweeb.org> <20221018081635.1617-5-kiizuha@gnuweeb.org> From: Muhammad Rizki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 20/10/2022 05.44, Alviro Iskandar Setiawan wrote: > On Tue, Oct 18, 2022 at 3:16 PM Muhammad Rizki wrote: >> Improvement on the fix_utf8_char() and change the logic at the >> create_template(). Use the `platform == "discord"` to clean html escape. >> >> Signed-off-by: Muhammad Rizki > > tq for the patch > > Instead of having platform == "discord" (string compare), can you make > them integer constant? > e.g.: > > enum { > PL_TELEGRAM = 1 > PL_DISCORD = 2 > }; > > which is much cheaper to compare than string. IDK about enum in > Python, maybe just a global constant var or class property that does > the same thing? > > -- Viro Actually, I can do it. Just use an enums library and make a class Platform and use it like Platform.DISCORD or Platform.TELEGRAM