[Python-Dev] Finding the module from PyTypeObject? (original) (raw)
Michael Hudson mwh at python.net
Thu Sep 30 13:46:59 CEST 2004
- Previous message: [Python-Dev] Finding the module from PyTypeObject?
- Next message: [Python-Dev] Finding the module from PyTypeObject?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick Bastin <nbastin at opnet.com> writes:
On Sep 29, 2004, at 4:17 PM, Armin Rigo wrote:
Hello Nick,
On Wed, Sep 29, 2004 at 01:24:23PM -0400, Nick Bastin wrote: Ok, maybe more appropriately, what do people think of adding a PyTypeGetModule (PyTypeObject *) which basically functions like typemodule(PyTypeObject *, void *) (in Objects/typeobject.c) to the public C API, rather than having to dig around in the object themselves? It looks overkill, when you can do instead: PyObject* modulename = PyObjectGetAttrString(type, "module"); That only works most of the time, I think. To be honest, I didn't try that, but it doesn't seem that typemodule would jump through the hoops it does if that worked all of the time, unless parsing tpname is legacy code.
Huh? The code above winds up calling type_module!
Cheers, mwh
-- i am trying to get Asterisk to work it is stabbing me in the face yes ... i seem to recall that feature in the documentation -- from Twisted.Quotes
- Previous message: [Python-Dev] Finding the module from PyTypeObject?
- Next message: [Python-Dev] Finding the module from PyTypeObject?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]