Re: delegation pattern via descriptor

2010-07-09 Thread Gregory Ewing
kedra marbun wrote: this 'passing class' thing comes from, IIRC, learning python 4ed by Mark Lutz, it's stated there that the 3rd arg to __get__ is the class to which the descriptor instance is attached That's there so that the __get__ method of function objects can return an unbound method whe

Re: delegation pattern via descriptor

2010-07-09 Thread kedra marbun
On Jul 8, 5:10 pm, Gregory Ewing wrote: > kedra marbun wrote: > > i wonder what are the reasons for > > not passing the class on which the descriptor is attached to, what > > pattern is encouraged by this? > > The same answer applies. It's assumed that you will be > writing a custom piece of code

Re: delegation pattern via descriptor

2010-07-09 Thread kedra marbun
On Jul 8, 4:02 pm, Bruno Desthuilliers wrote: > kedra marbun a écrit : > > > > > On Jul 7, 2:46 am, Bruno Desthuilliers > > wrote: > >> Gregory Ewing a écrit : > > >>> Bruno Desthuilliers wrote: > kedra marbun a écrit : > > if we limit our discussion to py: > > why __{get|set|delete}

Re: delegation pattern via descriptor

2010-07-08 Thread Gregory Ewing
kedra marbun wrote: i wonder what are the reasons for not passing the class on which the descriptor is attached to, what pattern is encouraged by this? The same answer applies. It's assumed that you will be writing a custom piece of code for each attribute of each class, and giving each one its

Re: delegation pattern via descriptor

2010-07-08 Thread Bruno Desthuilliers
kedra marbun a écrit : On Jul 7, 2:46 am, Bruno Desthuilliers wrote: Gregory Ewing a écrit : Bruno Desthuilliers wrote: kedra marbun a écrit : if we limit our discussion to py: why __{get|set|delete}__ don't receive the 'name' & 'class' from __{getattribute|{set|del}attr}__ 'name' is the na

Re: delegation pattern via descriptor

2010-07-07 Thread kedra marbun
On Jul 6, 12:11 pm, Steven D'Aprano wrote: > On Mon, 05 Jul 2010 21:12:47 -0700, kedra marbun wrote: > > On Jul 5, 7:49 am, Gregory Ewing wrote: > >> kedra marbun wrote: > >> > now, i'm asking another favor, what about the 2nd point in my 1st > >> > post? > > >> Your original post has dropped off

Re: delegation pattern via descriptor

2010-07-07 Thread kedra marbun
On Jul 7, 2:46 am, Bruno Desthuilliers wrote: > Gregory Ewing a écrit : > > > Bruno Desthuilliers wrote: > >> kedra marbun a écrit : > > >>> if we limit our discussion to py: > >>> why __{get|set|delete}__ don't receive the 'name' & 'class' from > >>> __{getattribute|{set|del}attr}__ > >>> 'name'

Re: delegation pattern via descriptor

2010-07-06 Thread Bruno Desthuilliers
Gregory Ewing a écrit : > Bruno Desthuilliers wrote: >> kedra marbun a écrit : >> >>> if we limit our discussion to py: >>> why __{get|set|delete}__ don't receive the 'name' & 'class' from >>> __{getattribute|{set|del}attr}__ >>> 'name' is the name that is searched >> >> >> While it would have been

Re: delegation pattern via descriptor

2010-07-06 Thread Bruno Desthuilliers
kedra marbun a écrit : On Jul 5, 3:42 pm, Bruno Desthuilliers wrote: kedra marbun a écrit : i'm confused which part that doesn't make sense? this is my 2nd attempt to py, the 1st was on april this year, it was just a month, i'm afraid i haven't got the fundamentals right yet. so i'm gonna l

Re: delegation pattern via descriptor

2010-07-05 Thread Rami Chowdhury
On Monday 05 July 2010 21:10:51 kedra marbun wrote: > On Jul 5, 3:42 pm, Bruno Desthuilliers > 42.desthuilli...@websiteburo.invalid> wrote: > > kedra marbun a écrit : > > > i'm confused which part that doesn't make sense? > > > this is my 2nd attempt to py, the 1st was on april this year, it was

Re: delegation pattern via descriptor

2010-07-05 Thread Steven D'Aprano
On Mon, 05 Jul 2010 21:12:47 -0700, kedra marbun wrote: > On Jul 5, 7:49 am, Gregory Ewing wrote: >> kedra marbun wrote: >> > now, i'm asking another favor, what about the 2nd point in my 1st >> > post? >> >> Your original post has dropped off my newsscope, so you'll have to >> remind me what the

Re: delegation pattern via descriptor

2010-07-05 Thread kedra marbun
On Jul 5, 7:49 am, Gregory Ewing wrote: > kedra marbun wrote: > > now, i'm asking another favor, what about the 2nd point in my 1st post? > > Your original post has dropped off my newsscope, so > you'll have to remind me what the 2nd point was. > > -- > Greg it's like 'name', it's about info that

Re: delegation pattern via descriptor

2010-07-05 Thread kedra marbun
On Jul 5, 3:42 pm, Bruno Desthuilliers wrote: > kedra marbun a écrit : > > > > > i'm confused which part that doesn't make sense? > > this is my 2nd attempt to py, the 1st was on april this year, it was > > just a month, i'm afraid i haven't got the fundamentals right yet. so > > i'm gonna lay out

Re: delegation pattern via descriptor

2010-07-05 Thread Bruno Desthuilliers
kedra marbun a écrit : i'm confused which part that doesn't make sense? this is my 2nd attempt to py, the 1st was on april this year, it was just a month, i'm afraid i haven't got the fundamentals right yet. so i'm gonna lay out how i got to this conclusion, CMIIW **explanation of feeling (0) on

Re: delegation pattern via descriptor

2010-07-04 Thread Gregory Ewing
kedra marbun wrote: now, i'm asking another favor, what about the 2nd point in my 1st post? Your original post has dropped off my newsscope, so you'll have to remind me what the 2nd point was. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: delegation pattern via descriptor

2010-07-04 Thread kedra marbun
thanks Greg, you get most of what i meant like i said before, i suspect descriptor encourages dedicated / not shared descriptor obj. this encouragement is expressed in the design, and the reasons behind the design were the ones that i was asking about, not how to get around it now, i'm asking anot

Re: delegation pattern via descriptor

2010-07-04 Thread kedra marbun
i'm confused which part that doesn't make sense? this is my 2nd attempt to py, the 1st was on april this year, it was just a month, i'm afraid i haven't got the fundamentals right yet. so i'm gonna lay out how i got to this conclusion, CMIIW **explanation of feeling (0) on my 1st post** to me, des

Re: delegation pattern via descriptor

2010-07-03 Thread Gregory Ewing
Bruno Desthuilliers wrote: kedra marbun a écrit : if we limit our discussion to py: why __{get|set|delete}__ don't receive the 'name' & 'class' from __{getattribute|{set|del}attr}__ 'name' is the name that is searched While it would have been technically possible, I fail to imagine any use c

Re: delegation pattern via descriptor

2010-07-03 Thread Bruno Desthuilliers
kedra marbun a écrit : > if we limit our discussion to py: > why __{get|set|delete}__ don't receive the 'name' & 'class' from > __{getattribute|{set|del}attr}__ > 'name' is the name that is searched While it would have been technically possible, I fail to imagine any use case for this. -- http:/

Re: delegation pattern via descriptor

2010-07-03 Thread Thomas Jollans
On 07/03/2010 10:59 AM, kedra marbun wrote: > if we limit our discussion to py: > why __{get|set|delete}__ don't receive the 'name' & 'class' from > __{getattribute|{set|del}attr}__ > 'name' is the name that is searched > 'class' is the class whose __dict__ has 'name' bound to descriptor http://us

Re: delegation pattern via descriptor

2010-07-03 Thread Mark Lawrence
On 02/07/2010 14:28, kedra marbun wrote: hello, friendliest prog lang community on earth ;) Flattery will get you everywhere. [snip] wow, it's almost time for brazil to beat the dutch, sorry Guido ;) if fifa['wc']['2010'].winner is not brazil: raise SystemError Have you run this and get yo

Re: delegation pattern via descriptor

2010-07-03 Thread kedra marbun
if we limit our discussion to py: why __{get|set|delete}__ don't receive the 'name' & 'class' from __{getattribute|{set|del}attr}__ 'name' is the name that is searched 'class' is the class whose __dict__ has 'name' bound to descriptor delegator & delegator are terms from delegation pattern (oop) w

Re: delegation pattern via descriptor

2010-07-02 Thread Steven D'Aprano
On Fri, 02 Jul 2010 06:28:59 -0700, kedra marbun wrote: > 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 th

delegation pattern via descriptor

2010-07-02 Thread kedra marbun
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 stre