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 [10.7.7.5] (unknown [182.253.183.247]) by gnuweeb.org (Postfix) with ESMTPSA id 312D9804D1; Fri, 21 Oct 2022 14:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666363562; bh=y2UJeoBXlViPdxDkYmFy6wpO6E5XeH1yFaYCor/Db5c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=MHZSfRkr4ZgN44AP/JEr9nN5eX4s+A6Dx+XjpJuDH/kcoKSaa1H9lynTcbY/lnNUm uP16AJBQGF/VK/1Amlthc5Vpln2B7OvxQl4TOtUBw8OJTZcGUyY9Pw7ehW1nWUZv9s 9Fj4wOy3rFi1sKCZN3hJouQ/kXLiQ4CkQ2ZGqXhr9uK6zYpDIcpS77/3nIsQ6hfrr6 tJl+138VhLwS3L4DVIFP5dh2HT8xPkFX3tluq1IHhAb86oNS9vWIUDOVUDxAvkMNXo KRAEssQ8+J7Y+YNQKuNVceo5u1566QBoM/8Yz/yG+BB+ke7mBE7RiASttC6poKsdu+ Y2Zk6h8Ic511A== Message-ID: <77f5a9df-0268-0e54-262c-ab53cc9bb43d@gnuweeb.org> Date: Fri, 21 Oct 2022 21:45:57 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v3 8/9] enum: Add Platform enumeration Content-Language: en-US To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221021134520.701-1-kiizuha@gnuweeb.org> <20221021134520.701-9-kiizuha@gnuweeb.org> <6fb1d238-de6a-325c-8d17-6801ae24c717@gnuweeb.org> <982b723b-5c22-cfe2-6fcf-d0584b8c142d@gnuweeb.org> <90fb2819-443d-2665-e42b-b069e7dbbaff@gnuweeb.org> <64f50068-72bc-6f53-17f5-54826bd7947f@gnuweeb.org> From: Ammar Faizi In-Reply-To: <64f50068-72bc-6f53-17f5-54826bd7947f@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 10/21/22 9:34 PM, Muhammad Rizki wrote: > So, you don't want to use extra library or worry about the enum.auto()? > If you worry about the enum.auto(), then I just simply declare it as a > number. If you don't want to use the extra library then I follow what > you want here. I'm not against using an extra library, I just don't see the need of using a library to define enum. That's why I'm bothered. > It just auto generated name to make it readable when printing out or use > it as a string value. You can see at gen_temp() in utils.py, I use it as > its string name value to choose where the temporary folder to create is. > It's simpler, if you want to declare it as an integer, then it's more > way complicated because it will use an if statement like the old one does. > > What do you think? Oh, I didn't know. I thought auto() just returns a simple unique number. I have a question about that. x = Platform.DISCORD print(x) What does the print() statement show? And if it shows something about DISCORD. How does it save the information about DISCORD by only defining it as: DISCORD = enum.auto() Care to explain? -- Ammar Faizi