From: "R. David Murray" <[EMAIL PROTECTED]>


> On Sat, 26 Aug 2000, Loren Stafford wrote:
> >   def index_object(self):
> >     if self.nextEventTime() is not None:
> >         CatalogAware.index_object.im_func(self)
> >         # see Python Reference Manual "The standard type hierarchy"
> >         # for the built-in type im_func
>
> I realize this is a Python and a not a Zope question, but
> what is the difference between
>
>   CatalogAware.index_object.im_func(self)
>
> and
>
>   CatalogAware.index_object(self)
>
> ?
>
> --RDM
>

Here's what MJ told me about that case. I'm not sure it applies to your
case. Did you try it? Did it work?

-- Loren

----- Original Message -----
From: "Martijn Pieters" <[EMAIL PROTECTED]>
To: "Loren Stafford" <[EMAIL PROTECTED]>; "zope-dev"
<[EMAIL PROTECTED]>
Sent: March 01, 2000 11:57 AM
Subject: [Zope-dev] Re: What is im_func?

> From: "Loren Stafford" <[EMAIL PROTECTED]>
> > Could you elaborate on what im_func is and what it's role is here.
> >
> >     # Only index if nextEventTime returns something
> >     def index_object(self):
> >         if self.nextEventTime() is not None:
> >             CatalogAware.index_object.im_func(self)
>
> im_func is a part of Python introspection. It is the pure function
> definition of a class, not bound to that class, so I can pass in an
> alternate self.
>
> I am trying to call a superclass method here, and normally
> CatalogAware.index_object() would suffice. But because of Extension
Classes,
> Python gets confused as to what is a class method, and what is a regular
> function. It will accuse me of calling an unbound method, which of course
I
> am not. I circumvent this by calling the unbound function, and passing in
> self explicitly.
>
> Martijn Pieters
>


_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to