super().__init__() and bytes

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Dec 3 18:14:17 EST 2024


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



More information about the Python-list mailing list