__bases__ misleading error message

Mario Figueiredo marfig at gmail.com
Sat Jan 24 17:02:19 EST 2015


In article <mailman.18102.1422136703.18130.python-list at python.org>, 
tjreedy at udel.edu says...
> 
> >      "__main__"
> >      from module import a_name
> 
> A module is a namespace associating names with objects.  This statememt 
> says to import the a_name to object association from module and add it 
> to __main__
> 
> >      y = a_name + 1
> 
> This statement uses the imported association in __main__ to access the 
> object and add 1, and bind 'y' to the resulting object.


But I'm being told the interpreter has no knowledge of a variable name. 
So, how does the interpreter know, once it reaches the assigment line 
above, how to map a_name to the correct object in memory?



More information about the Python-list mailing list