From: John Posner on
On 3/1/2010 2:59 PM, Bruno Desthuilliers wrote:

> Answer here:
>
> http://groups.google.com/group/comp.lang.python/tree/browse_frm/thread/bd71264b6022765c/3a77541bf9d6617d#doc_89d608d0854dada0
>
> I really have to put this in the wiki :-/


Bruno, I performed a light copy-edit of your writeup and put in some
reStructuredText (reST) markup. The result is at:

http://cl1p.net/bruno_0301.rst/

The only sentence that I think needs work is:

Having access to itself (of course), the
instance (if there's one) and the class, it's easy for it
to wrap all this into a **method** object.

Maybe this?

With the instance object (if any) and class object available,
it's easy to create a method object that wraps the function object.


Begging pardon for my presumptuousness,
John

From: Bruno Desthuilliers on
John Posner a �crit :
> On 3/1/2010 2:59 PM, Bruno Desthuilliers wrote:
>
>> Answer here:
>>
>> http://groups.google.com/group/comp.lang.python/tree/browse_frm/thread/bd71264b6022765c/3a77541bf9d6617d#doc_89d608d0854dada0
>>
>>
>> I really have to put this in the wiki :-/
>
>
> Bruno, I performed a light copy-edit of your writeup and put in some
> reStructuredText (reST) markup. The result is at:
>
> http://cl1p.net/bruno_0301.rst/

Cool.

>
> The only sentence that I think needs work is:
>
> Having access to itself (of course), the
> instance (if there's one) and the class, it's easy for it
> to wrap all this into a **method** object.
>
> Maybe this?
>
> With the instance object (if any) and class object available,
> it's easy to create a method object that wraps the function object.

That's perfect.

But there's also a typo to fix in the Python implementation of the
Method object: in the call method, it should inject self.im_self as
first arg, not self.im_func. This had been spotted by someone named John
Posner, IIRC !-)


>
> Begging pardon for my presumptuousness,

Begging pardon for my laziness :-/
From: John Posner on
On 3/2/2010 3:57 AM, Bruno Desthuilliers wrote:
>>
>> With the instance object (if any) and class object available,
>> it's easy to create a method object that wraps the function object.
>
> That's perfect.


Fixed.

> But there's also a typo to fix in the Python implementation of the
> Method object: in the call method, it should inject self.im_self as
> first arg, not self.im_func. This had been spotted by someone named John
> Posner, IIRC !-)


Fixed (oops!).

I've updated the text at this location:

> http://cl1p.net/bruno_0301.rst/

I think the ball is back in your court, Bruno. I'd be happy to help more
-- feel free to contact me off-list, at jjposner(a)optimum.net.

Best,
John

From: Eike Welk on
John Posner wrote:
> I've updated the text at this location:
>
> > http://cl1p.net/bruno_0301.rst/

I think this is a very useful writeup!

It would be perfect with a little bit of introduction that says:
1. - What it is: "The rough details of method look-up";
2. - which contains some of the questions that that made that authors write
the text. This way people with similar questions can find it with Google.

Additionally the link to the relevant section in the Python documentation
would be great. I can't find it!

A link to an article about the details of class creation and metaclasses
would be good too.


Thanks for writing this great little text,
Eike.

From: Bruno Desthuilliers on
John Posner a �crit :
> On 3/3/2010 5:56 AM, Bruno Desthuilliers wrote:
>> Eike Welk a �crit :
>>> John Posner wrote:
>>>> I've updated the text at this location:
>>>>
>>>> > http://cl1p.net/bruno_0301.rst/
>>>
>>> I think this is a very useful writeup!
>>> It would be perfect with a little bit of introduction that says:
>>> 1. - What it is: "The rough details of method look-up";
>>> 2. - which contains some of the questions that that made that authors
>>> write the text. This way people with similar questions can find it
>>> with Google.
>>>
>>
>> John, do you think you could something with the following ?
>
> Sure thing, Bruno. I'll incorporate/edit your new text below into a
> Python Wiki entry. The headings in the Documentation table of contents
> page (http://wiki.python.org/moin/Documentation) seem pretty sober, so I
> plan to use a straightforward title:
>
> FromFunctionsToMethods

What about "TheMagicBehindMethods" ? Mmm, not sure, so do what you think
is best.

> ... instead of the clearly superior ...
>
> ItsAFunctionItsAMethodItsAUseOfTheDescriptorProtocol
>
> Does this article belong in the "Advanced Topics" section of the page?
> I'm not sure, but I'll place it there for now. (Alternative suggestions
> welcome!)

I spotted this:

http://www.python.org/doc/faq/programming/#what-is-a-method
http://www.python.org/doc/faq/general/#why-must-self-be-used-explicitly-in-method-definitions-and-calls

Our text is probably a bit too long for a direct inclusion in the FAQ,
so I'd say it should go in the AdvancedTopics, and be linked from the FAQ.

>
> Yow, the mantle of responsibility weighs heavily upon my poor shoulders!

!-)


Thanks for doing the grunt work.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6
Prev: getting rpy2 from repository
Next: cpan for python?