Lies in education [was Re: The "loop and a half"]

Chris Angelico rosuav at gmail.com
Fri Oct 13 01:24:31 EDT 2017


On Fri, Oct 13, 2017 at 4:16 PM, Steve D'Aprano
<steve+python at pearwood.info> wrote:
> On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote:
>
>> If the compiler can tell where p is initially pointing, it could
>> put the pointer in read-only memory.
>
> If it's read-only, how can the compiler write to it?
>
>
> (I come from the days when ROM was actual ROM, burned in at the factory.)

Code pages (nothing to do with eight-bit character sets, I mean memory
pages containing program code) are often - and should always be -
read-only by default. The compiler can put constants into the code
segment and reference them that way.

ChrisA



More information about the Python-list mailing list