Re: Set/Get attribute syntatic sugar

2005-06-29 Thread szport
> e = 'i_am_an_attribute' > o.(e) = 10 > o.i_am_an_attribute == 10 Yes I mean this thing: to write o.(e) = 10 or o.[e] = 10 -- http://mail.python.org/mailman/listinfo/python-list

Re: Set/Get attribute syntatic sugar

2005-06-29 Thread szport
Yes, I mean this thing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Set/Get attribute syntatic sugar

2005-06-29 Thread Michael Hoffman
Peter Hansen wrote: > Elmo Mäntynen wrote: > >> Maybe funny, but a bit too cocky for my taste. Robert kern is propably >> right about what he really meant so don't be too hasty in the future, >> right?). > > Elmo, it's probably neither cocky nor funny, but before you pass > judgment you should

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Peter Hansen
Elmo Mäntynen wrote: > > Peter Hansen wrote: >>Заур Шибзухов wrote: >>>Anybody thought about this issue? >> >>Perhaps not, but now that you've pointed it out they've taken the time >>machine back and fixed the problem before it arose: > > Maybe funny, but a bit too cocky for my taste. Robert kern

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Terry Hancock
On Tuesday 28 June 2005 07:07 pm, Elmo Mäntynen wrote: > Peter Hansen wrote: > > Заур Шибзухов wrote: > >> There is a syntactic sugar for item access in > >> dictionaries and sequences: > >> o[e] = v <-> o.__setitem__(e, v) > >> o[e] <-> o.__getitem__(e) > >> > >> where e is an expression. > >> > >

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Elmo Mäntynen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter Hansen wrote: > Заур Шибзухов wrote: > >> There is a syntactic sugar for item access in >> dictionaries and sequences: >> >> o[e] = v <-> o.__setitem__(e, v) >> o[e] <-> o.__getitem__(e) >> >> where e is an expression. >> >> There is no similar

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Gary Wilson Jr
Заур Шибзухов wrote: > There is a syntactic sugar for item access in > dictionaries and sequences: > > o[e] = v <-> o.__setitem__(e, v) > o[e] <-> o.__getitem__(e) > > where e is an expression. > > There is no similar way for set/get attribute for objects. > If e is a given name, then > >

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Michael Hoffman
Robert Kern wrote: >> Заур Шибзухов wrote: >> >>> There is a syntactic sugar for item access in >>> dictionaries and sequences: >>> >>> o[e] = v <-> o.__setitem__(e, v) >>> o[e] <-> o.__getitem__(e) >>> >>> where e is an expression. >>> >>> There is no similar way for set/get attribute for objects.

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Robert Kern
Peter Hansen wrote: > Заур Шибзухов wrote: > >>There is a syntactic sugar for item access in >>dictionaries and sequences: >> >>o[e] = v <-> o.__setitem__(e, v) >>o[e] <-> o.__getitem__(e) >> >>where e is an expression. >> >>There is no similar way for set/get attribute for objects. >>If e is a gi

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Peter Hansen
Заур Шибзухов wrote: > There is a syntactic sugar for item access in > dictionaries and sequences: > > o[e] = v <-> o.__setitem__(e, v) > o[e] <-> o.__getitem__(e) > > where e is an expression. > > There is no similar way for set/get attribute for objects. > If e is a given name, then > >