changing a value of a variable

Peter Hansen peter at engcorp.com
Wed Jan 30 00:22:10 EST 2002


Aahz Maruch wrote:
> 
> In article <mailman.1012353050.29181.python-list at python.org>,
> =?iso-8859-1?q?Fran=E7ois?= Pinard <pinard at iro.umontreal.ca> wrote:
> >[Marcin Matuszkiewicz]
> >>
[snip C code]
> >Hello, Marcin.  As others told you, we prefer avoiding such things in Python.
> >But if you just cannot escape it, you may do stunts like this one:
> >
[snip Python code]
> 
> Correct me if I'm wrong, but I believe that is not in any way equivalent
> to the C code above.  Not being a C programmer, I'm not absolutely
> positive, but I think you need to use assign(&n) in order for the code
> to work.

You're absolutely correct, but I believe those responding are either 
missing the mistake by seeing the pattern they think should be there, 
or they are deliberately making allowances for typos in example code 
and responding to the question they thought was actually being asked 
(where the call to assign does use &n).

-Peter



More information about the Python-list mailing list