the annoying, verbose self
Neil Cerutti
horpner at yahoo.com
Tue Nov 27 09:38:21 EST 2007
On 2007-11-26, Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> wrote:
> Patrick Mullen a écrit :
> (snip)
>> Still an unnecessary lookup on tmp though :) And it would be useless
>> to use it for one assignment, the idea is to eliminate all the typing
>> with this:
>>
>> self.var1 = 5
>> self.var2 = "a value"
>> self.var3 = stuff
>> self.var4 = [2,54,7,7]
>> self.var5 = "dingaling"
>> self.var6 = 6.4
>> self.var7 = 1
>> self.var8 = False
>> self.var9 = True
>
> self.__dict__.update(dict(var1=5, var2="a value", var3 = stuff, <etc>))
>
> Someone else ? Or are we done with this DeadHorse ?
I was really upset about having to type 'self' all the time,
until I learned that in ABC, one of Python's precursors, you had
to use '__anInstanceOf_This_TYPE_or_Maybe_A__SubClassOfItInstead_arg0_'.
--
Neil Cerutti
Sermon Outline: I. Delineate your fear II. Disown your fear III. Displace your
rear --Church Bulletin Blooper
More information about the Python-list
mailing list