Chaos a écrit :
> Is It possible to have reference variables like in PHP
>
> ex.
>
>
> $x = 1;
> $y =& $x;
>
> $y += 1;
>
> echo $x;
> echo "\n"
> echo $y;
>
> ?>
>
> This would show
>
> 2
> 2
>
> Is this available in python?
See other replies (ie. in Python all variables are names refer
Luke Plant wrote:
> You should note that, to a nearest equivalent, all variables are
> reference variables in Python. The difference is in what assignment
> does - += in Python does an assignment of a new object for immutable
> objects. For mutable objects like lists, += does an in place
> mod
Chaos wrote:
> Is It possible to have reference variables like in PHP
...
> Is this available in python?
You should note that, to a nearest equivalent, all variables are
reference variables in Python. The difference is in what assignment
does - += in Python does an assignment of a new object f
On 2006-08-15, Chaos <[EMAIL PROTECTED]> wrote:
> Is It possible to have reference variables like in PHP
>
> ex.
>
>
> $x = 1;
> $y =& $x;
>
> $y += 1;
>
> echo $x;
> echo "\n"
> echo $y;
>
> ?>
>
> This would show
>
> 2
> 2
>
> Is this available in python?
If you store an item in a one-element li
"Chaos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is It possible to have reference variables like in PHP
> $x = 1;
> $y =& $x;
> $y += 1;
> echo $x;
> echo "\n"
> echo $y;
> ?>
>
> This would show
> 2
> 2
> Is this available in python?
No, in the literal meaning of your ques
Is It possible to have reference variables like in PHP
ex.
This would show
2
2
Is this available in python?
--
http://mail.python.org/mailman/listinfo/python-list