the annoying, verbose self

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Mon Nov 26 14:20:48 EST 2007


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 ?



More information about the Python-list mailing list