A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/302589.html below:

return (PyObject*)myPyType; ...segmentation fault!

return (PyObject*)myPyType; ...segmentation fault! return (PyObject*)myPyType; ...segmentation fault!Fredrik Lundh fredrik at pythonware.com
Fri Sep 30 09:32:31 EDT 2005
"elho" wrote:

>> > It is said that the object has a NULL-Pointer when I try to debug it?
>> what object?
>   the python one  'myNewPyType'
>
> Sorry, I forgot to change:
>   PySDLXMLNodeType = PyMyType
> ..above the corrections

>    self = new PyMyObject
>    self->lAttribute = lAttribute;
>
>    return (PyObject*)self;

unless you have some really clever C++ magic in there that I'm not seeing,
you cannot just use "new" plus a cast to get a valid Python object.

if you want to explicitly create an object, you can use PyObject_New:

    http://www.python.org/doc/2.1.3/ext/dnt-basics.html

an alternative is to expose the type object, and leave the rest to Python:

    http://www.python.org/doc/current/ext/dnt-basics.html

</F> 




More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4