[C++-SIG] Trouble getting a method called

Barry Scott barry at scottb.demon.co.uk
Tue May 23 00:05:57 CEST 2000


> > 3. from python do print dir(your_module) - check for all the module
> >    attributes
> 
> >>> print dir( seh_test )
> ['__doc__', '__file__', '__name__','some_pod']
> 
> Okay.

	The module is good.

> > 4. from python do print dir(your_object) - check for all the object
> >    attributes
> 
> >>> p = some_pod( "a string" )
> Constructing some_pod( "a string" ): 0xd8c60
> >>> print dir( p )
> []
> 
> Uh oh.

	Here is the problem. The object p does not have any attributes.

	I suggest that you add cout << debug statements to confirm that
	the init_type() and getattr() are really called.

> > 5. from python do print your_object.__methods__ - check for all your
> >    methods
> 
> >>> print p.__methods__
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> RuntimeError: Extension object missing a required method.

	This is almost certainly the default getattr code running.
	Which only happens, in my experience, if init_type() is not 
	called.
> 
> Uh oh.
> 
> 
> Anything else I can check?

	Make sure you have the latest sources from SourceForge.

	Make sure that the Demo example module works.

			BArry





More information about the Cplusplus-sig mailing list