Sujet : Re: super().__init__() and bytes
De : greg.ewing (at) *nospam* canterbury.ac.nz (Greg Ewing)
Groupes : comp.lang.pythonDate : 04. Dec 2024, 00:14:17
Autres entêtes
Message-ID : <lr9hm9F77vdU1@mid.individual.net>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:91.0) Gecko/20100101 Thunderbird/91.3.2
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