Python internals

Scott David Daniels Scott.Daniels at Acm.Org
Wed Jul 16 08:40:30 EDT 2008


Peter Anderson wrote:
> Thanks everyone!  Just a quick correction - "as the original poster is" 
> is a bit of a jump that does not reflect my original question. I DO 
> understand how C and other programming languages handle variables 
> internally (the bits of actual memory reserved, etc. etc.) and that's 
> why I asked the question in the first place.
> 
> If Python doesn't do it like C and the others then what mechanism does 
> it use - it's the sort of issue that helps me understand how the 
> language is interacting with the underlying operating system/hardware.

The easiest way to think of this is that Python uses mostly dictionaries
dictionaries for namespaces, and a few places it uses other techniques
if there are over-riding considerations that make the dictionaries
impractical in particular cases.  Python performance would be crippled
if their dictionary implementation(s) slowed down, much as C performance
would suffer is access to RAM slowed down.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list