Class methods on user types

H

Heiko Wundram

Hi all!

I've written a user type, and I've declared class methods on it. Now...
Strange things are'a happening, and the class methods which are declared on
the type get the following output from pydoc:

| bin = <built-in method bin of type object>
<actual doc>
| fac = <built-in method fac of type object>
<actual doc>
etc...

The methods are declared in the PyMethodDef array of the class with the
following syntax:

{"bin", (PyCFunction)GMPi_bin,
METH_CLASS | METH_VARARGS | METH_KEYWORDS,
GMPi_bin_doc},

{"fac", (PyCFunction)GMPi_fac,
METH_CLASS | METH_VARARGS | METH_KEYWORDS,
GMPi_fac_doc},

etc.

If I've understood the documentation correctly, this should create the
appropriate class methods on the type. But why are they being attributed to
type? Is it something I've done wrong in the declaration, or is this just the
way it works?

Any info appreciated!

puzzeldly-y'rs,

Heiko.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,651
Latest member
VeraPiw932

Latest Threads

Top