Can global variable be passed into Python function?
marko at pacujo.net
Sun Feb 23 16:24:42 CET 2014
Chris Angelico <rosuav at gmail.com>:
> On Sun, Feb 23, 2014 at 10:01 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
>> As for Python, there's nothing in the Python specification that would
>> prevent you from having, say, 63-bit integers as representing
>> themselves. IOW, you could physically place such integers as
>> themselves as the reference and the number would not physically exist
> What would id(5) be? Some constant? What would id(id()) be?
Any suitable scheme would do. For example, id(n) == n for 63-bit
integers; other objects are dynamically sequence-numbered starting from
a high base (here, 2 ** 64):
Or id(n) == 2 * n for 63-bit integers; other objects are dynamically
sequence-numbered using only odd integers starting from 1:
Or id(n) == 2 ** 64 + n for 63-bit integers; other objects get the
RAM address of the internal ḿemory block:
The possibilities are endless.
More information about the Python-list