Re: Class subscripting

2006-02-17 Thread Steven D'Aprano
On Sat, 18 Feb 2006 01:09:22 +0100, Ronny Mandal wrote: > Assume we have a class Foo, and instance called bar. > > a variable called baz1 has the value 3.0, baz2 is uninitialized Python doesn't have variables. It has names which are bound to objects. Do you mean that the name baz1 is bound to th

Re: Class subscripting

2006-02-17 Thread skip
Ronny> Assume we have a class Foo, and instance called bar. a variable Ronny> called baz1 has the value 3.0, baz2 is uninitialized Ronny> Is there a way of reflecting the variable with such syntax: Ronny> print bar[], where var_index is a number representing Ronny> internal

Re: Class subscripting

2006-02-17 Thread Larry Bates
Ronny Mandal wrote: > Assume we have a class Foo, and instance called bar. > > a variable called baz1 has the value 3.0, baz2 is uninitialized > > Is there a way of reflecting the variable with such syntax: > > print bar[], where var_index is a number representing > internal index. > > bar[] =

Re: Class subscripting

2006-02-17 Thread Ian Leitch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ronny Mandal wrote: > Assume we have a class Foo, and instance called bar. > > a variable called baz1 has the value 3.0, baz2 is uninitialized > > Is there a way of reflecting the variable with such syntax: > > print bar[], where var_index is a numb

Class subscripting

2006-02-17 Thread Ronny Mandal
Assume we have a class Foo, and instance called bar. a variable called baz1 has the value 3.0, baz2 is uninitialized Is there a way of reflecting the variable with such syntax: print bar[], where var_index is a number representing internal index. bar[] = 4.2. #Setting baz2 to 4.2 Thanks and re