Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Namespacedifference reading - writing ??

Reply
Thread Tools

Re: Namespacedifference reading - writing ??

 
 
Steven Taschuk
Guest
Posts: n/a
 
      06-27-2003
Quoth Peter Abel:
[...]
> Is there really a difference in namespacehandling depending
> on writing or reading variables?


Yes. Assigned-to variables are local; variables merely referred
to may be found in nested scopes.

"When a name is used in a code block, it is resolved using the
nearest enclosing scope. [...] If a name is bound in a block, it
is a local variable of that block. [...] If a name binding
operation occurs anywhere within a code block, all uses of the
name within the block are treated as references to the current
block. [...] The local variables of a code block can be determined
by scanning the entire text of the block for name binding
operations."
<http://www.python.org/doc/current/ref/naming.html>

(Note that defs and whatnot are also name-binding operations.)

--
Steven Taschuk w_w
,-= U
1 1

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any problems with writing the information into a file - Multi-users perform writing the same file at the same time ???? HNguyen ASP .Net 4 12-21-2004 01:53 PM
Reading/writing data to/from files into 2D array Modukuri VHDL 0 05-19-2004 04:03 PM
Re: problem in different clock speed when reading and writing from ram Chris Pruett VHDL 0 08-14-2003 06:14 AM
Re: problem in different clock speed when reading and writing from ram Pieter Hulshoff VHDL 0 08-13-2003 08:54 PM
Re: Namespacedifference reading - writing ?? Duncan Booth Python 0 06-27-2003 01:16 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57