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

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to