[Tutor] Glossory of terms in Python

Srinivas Iyyer srini_iyyer_bio at yahoo.com
Wed Oct 26 17:11:06 CEST 2005


Dear python experts, 

  I am a novice python learner and aspiring to become
decent python programmer. I am reading 'Learning
Python' by Mark Lutz et al.  and it is one of the good
books that I find in addition to Alan Gauld's book
'Learn to Program Using Python'.

While reading these books step-by-step and progressing
ahead, I feel that some of the terms are highly
volatile.  In simple terms, while reading about lambda
functions after reading a lot of stuff before, I am
unable to clearly define what is an expression and
what is a statement.  

Although, I know the difference and what exactly they
mean inherently in my mind, I am unable to comprehend
and move ahead. This reamins a stumblick block.  

What I feel is that to overcome this stumbling block,
I need a glossory of terms at the end of the book that
defines the critical terms that are very easy to
programmer paralance such as :
a. Statement - A statement is .......... . For eg.
xxxxxx is called a statment
b. Expression - An expression is something ........ .
For example, def f(x): xxx  return y is an expression.

c. Jump table: A jump table is a table where ......

d. Attribute : An attribute is a variable that is used
as an input to a function. For eg. def Xabl(a): here a
is an attribute. 


Such a glossory of terms would be a great gift from
python experts. This would help novice and learning
programmers who never talked the terms of computing
language in daily english. Whenever we come across
these terms I would refer to this glossory and refresh
my brain time to time.  I would love to paste this
glossory on my wall and gawk at them daily.  


What is your opinion ?

Thanks
Srini

--- Joris van Zwieten
<vanzwieten at science-and-technology.nl> wrote:

> Hi all,
> 
> I've a question, essentially about the import
> statement. Suppose I have
> two python files, a.py and b.py:
> 
> a.py
> ----
> flag = True
> 
> def getFlag():
>     return flag
> 
> b.py
> ----
> from a import *
> 
> now, in the interpreter:
> 
> >>> import b
> >>> b.flag
> True
> >>> b.flag=False
> >>> b.flag
> False
> >>> b.getFlag()
> True
> 
> this is probably related to namespaces? I find it
> very confusing, because
> after the import, b _does_ have an attribute called
> 'flag' (try dir(b)),
> which has the value that was assigned to it in a.py.
> (i.e. the second
> statement in the interpreter does not inject a new
> variable 'flag' into
> b.) however, modifications to 'flag' are not 'seen'
> by functions defined
> in a.py, called from b (i.e. b.getFlag()).
> could someone explain what is happening here?
> thanks,
> 
> 
> Joris van Zwieten
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


More information about the Tutor mailing list