[Python-bugs-list] [ python-Bugs-500539 ] Inaccuracy(?) in tutorial section 9.2

noreply@sourceforge.net noreply@sourceforge.net
Tue, 08 Jan 2002 07:20:05 -0800


Bugs item #500539, was opened at 2002-01-07 12:15
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=500539&group_id=5470

Category: Documentation
>Group: Not a Bug
>Status: Closed
>Resolution: Works For Me
Priority: 5
Submitted By: Andrew Koenig (arkoenig)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Inaccuracy(?) in tutorial section 9.2

Initial Comment:
Section 9.2 paragraph 3 defines a namespace as a
mapping from names to objects.  Perhaps I'm being picky
here, but isn't a namespace a mapping from names to
object references?  For example, doesn't executing the
expression "modname.the_answer = 42" as shown in
paragraph 5 cause modname.the_answer to refer to a
different object than the one to which it referred
previously, rather than affecting the specific object
to which modname.the_answer refers?

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-01-08 07:20

Message:
Logged In: YES 
user_id=3066

There is no difference between an object reference and an
object in Python code, so the statement in the tutorial is
correct.  The behavior you are describing as "object"
behavior seems to assume that there's some sort of
assignment  which mutates the object which is the current
value of the assignment target, but there is no such
operator.  I can see where this might be confusing for
programmers coming from C++, though.  ;-)

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=500539&group_id=5470