Re: list storing variables

2015-02-23 Thread Steven D'Aprano
Ben Finney wrote: >> In C language, there is &A for address of A > > There is no “address of a value” concept in Python. You access a value > by some reference, either a name or an item in a collection. When a > reference changes to reference some different value, other references > are not affec

Re: list storing variables

2015-02-23 Thread Marko Rauhamaa
Ian Kelly : > Obviously one can use any Turing-complete language to emulate features > of any other Turing-complete language, but I think the point is that > there is no syntactic support for it. While my "contribution" was made tongue-in-cheek, there's a grain of truth in every joke. First of a

Re: list storing variables

2015-02-23 Thread Chris Angelico
On Tue, Feb 24, 2015 at 6:06 AM, Marko Rauhamaa wrote: > What I'm saying is that there's nothing special about Python's object > model or variables. Guido could decide tomorrow to add a C-esque "&" > operator to Python without breaking a single existing Python program. > The Python compiler would

Re: list storing variables

2015-02-23 Thread Marko Rauhamaa
Peter Otten <__pete...@web.de>: > The OP explicitly mentions the & operator. There's no python analog to > that and the behavior shown below: > > $ cat pointers.c > #include > > int main() > { > int a = 2, b = 5; > int * Li[2] = { &a, &b }; > printf("%d %d\n", *Li[0], *Li[1]); > a = 3; >

Re: list storing variables

2015-02-23 Thread Marko Rauhamaa
"ast" : > Is there a way to define a container object able to store some > variables so that a change of a variable make a change in this object > content ? > > I dont need this feature. It is just something I am thinking about. > > In C language, there is &A for address of A In Python, you can a

Re: list storing variables

2015-02-23 Thread Dave Angel
On 02/23/2015 07:55 AM, ast wrote: hi a = 2; b = 5 Li = [a, b] Li [2, 5] a=3 Li [2, 5] Ok, a change in a or b doesn't impact Li. This works as expected Is there a way to define a container object able to store some variables so that a change of a variable make a change in this object c

list storing variables

2015-02-23 Thread ast
hi a = 2; b = 5 Li = [a, b] Li [2, 5] a=3 Li [2, 5] Ok, a change in a or b doesn't impact Li. This works as expected Is there a way to define a container object able to store some variables so that a change of a variable make a change in this object content ? I dont need this feature