Path: ...!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Greg Ewing Newsgroups: comp.lang.python Subject: Re: super().__init__() and bytes Date: Wed, 4 Dec 2024 12:14:17 +1300 Lines: 11 Message-ID: References: <3cc6272f-b151-474a-a83c-7f3339734bf5@roelschroeven.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Es60DR8UJPOrEE9aWlskggFTDtXCIMIlf4N7c8dMYTHhNb3TyZ Cancel-Lock: sha1:tqyqtoRmOtsURofQU4uUdp0ZCJo= sha256:bmKVM93iU0OkVRfUH+iLBRMbhtCUSXCg3d/5qHbkAWE= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Content-Language: en-US In-Reply-To: Bytes: 1528 On 4/12/24 3:24 am, Roel Schroeven wrote: > It's not entirely clear to me though how bytes.__new__ *can* set an > object's value. Isn't __new__ also a regular function? Yes, but the __new__ methods of the builtin immutable objects (int, str, bytes, etc.) are implemented in C, and so are able to do things that Python methods cannot. -- Greg