delegation pattern via descriptor

kedra marbun kedra.marbun at gmail.com
Fri Jul 2 09:28:59 EDT 2010


hello, friendliest prog lang community on earth ;)

i'm feeling that
(0) delegation pattern thru descriptor encourages dedicated delegate
for each task, if feeling: print(benefits)
(1) the delegate is designed to be blind about the class on which the
delegate is attached to

isn't that the two strengthen the coupling between delegator &
delegate
obviously __getattribute__ & his 2 friends of 'object' & 'type' have
what it takes to make it not like that, it's just that they're not
designed to pass it. thus i think it is by design

yes i know there's a way around it, the most obvious to me is defining
your own hooks (which is not trival, at least to me) , but like i
said, it's encouraged

wow, it's almost time for brazil to beat the dutch, sorry Guido ;)
if fifa['wc']['2010'].winner is not brazil: raise SystemError



More information about the Python-list mailing list