On Fri, Oct 13, 2017 at 4:16 PM, Steve D'Aprano <steve+pyt...@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 -- https://mail.python.org/mailman/listinfo/python-list