Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

Bengt Richter bokr at oz.net
Wed Aug 17 03:47:14 CEST 2005


On Tue, 16 Aug 2005 19:24:04 -0400, "Terry Reedy" <tjreedy at udel.edu> wrote:

>
>"Bengt Richter" <bokr at oz.net> wrote in message 
>news:4302228e.1621136831 at news.oz.net...
>> IOW, "...open the box and find the i'th item /in/ the box..." is not 
>> really
>> finding the i'th item _itself_ "/in/" the box. It is finding one end of a 
>> string
>> tied to some point /in/ the box, but the actual item/object is at the 
>> other end
>> of the string, not /in/ the box, and many other strings may potentially 
>> also
>> be leading to the same object, whether originating from anonymous 
>> structural
>> binding points in other objects, or named binding points in 
>> name-tag-containing
>> objects/namespaces.
>
>The way I think of it is that Python's collective objects are like club 
>rosters: one person (object) can be on many rosters.  A container would be 
>like a room, and a person could only be in one room at a time.
>
Yes, the roster model works for me too, but I'm not sure I understand your
concept of "container/room" ;-) I.e., at the Python object level, object representations
themselves don't contain each other in the sense of the memory layout of nested
C structs, UIAM? Obviously there are C structs for basic object representation information
layout, but object-level parts are aggregated by reference via pointers rather than
by memory adjacency (again UIAM). E.g., a list of floats is not an array of doubles in memory.
It's not even a list of pointers to doubles in cpython, I believe, even though
one could conceive of a form of object reference handle/pointers with type clues
in the LSBs that could make pointing to a float object be represented exactly
identically to a C pointer to double. (Since ints are much more commonly used
that would be a waste though, I think, since you would want to use LSB bits to
encode differentiation between the most common primitive types for special handling,
and it would probably be nice to do simple integer arithmetic without needing to mask,
but this is getting to other topics ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list