dir() on C object type

Ignacio Vazquez-Abrams ignacio at openservices.net
Mon Sep 17 07:20:45 CEST 2001

On Mon, 17 Sep 2001, Mark Rowe wrote:

> I've just been playing around with building some object types using C.
> Everything seems to be going fine, and I'm starting to get my head around
> the reference side of things, but one thing still bugs me.  When I execute
> the dir() function on an instance of my type, I get an empty list.  Is there
> something I need to do to have its methods show up?

You have to use Py_FindMethod() in your getattr handler with the special name

Ignacio Vazquez-Abrams  <ignacio at openservices.net>

More information about the Python-list mailing list