Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #197044

Re: super().__init__() and bytes

From Roel Schroeven <roel@roelschroeven.net>
Newsgroups comp.lang.python
Subject Re: super().__init__() and bytes
Date 2024-12-04 12:38 +0100
Message-ID <mailman.10.1733312315.2965.python-list@python.org> (permalink)
References (2 earlier) <VI1PR05MB106809E93AA17A3D46E380DFEB4362@VI1PR05MB10680.eurprd05.prod.outlook.com> <c5901834-52b0-4238-bda1-6b74220be68d@roelschroeven.net> <mailman.6.1733235899.2965.python-list@python.org> <lr9hm9F77vdU1@mid.individual.net> <b688c6ff-dc65-4649-9064-f0b6d0a90d94@roelschroeven.net>

Show all headers | View raw


Op 4/12/2024 om 0:14 schreef Greg Ewing via Python-list:
> 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.
Aha, yes, that's what I already suspected, but I wasn't sure. Thanks for 
confirming that.

All clear now. Thanks to Anders and Greg for explaining this to me.

"In the old days, writers used to sit in front of a typewriter and stare out of
the window. Nowadays, because of the marvels of convergent technology, the thing
you type on and the window you stare out of are now the same thing.”
         -- Douglas Adams

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar


Thread

Re: super().__init__() and bytes Roel Schroeven <roel@roelschroeven.net> - 2024-12-03 15:24 +0100
  Re: super().__init__() and bytes Greg Ewing <greg.ewing@canterbury.ac.nz> - 2024-12-04 12:14 +1300
    Re: super().__init__() and bytes Roel Schroeven <roel@roelschroeven.net> - 2024-12-04 12:38 +0100

csiph-web