473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

test if PyObject * points to real python object

Hi,

With the Python/C API, how do i test if a given PyObject * actually
points to a real/valid python object?

--
Cheers
David

Jul 18 '05 #1
1 1351
David McNab wrote:
With the Python/C API, how do i test if a given PyObject * actually
points to a real/valid python object?


As opposed to being a NULL pointer? o != NULL

As opposed to being a stray pointer, to garbage memory? You can't.

Regards,
Martin

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nikolai Kirsebom | last post by:
I'm using BOOST to integrate Python into our application. Could someone tell me how I get hold of the C++ object (pointer to the object instance) from a PyObject *. Example: I have defined and...
2
by: Donnie Leen | last post by:
I wrote a program to test calling c function from python code embedding in c as following, it cause error after running a while(about 398 circle). I test it in msvc6, python2.3, windows 2k, could...
0
by: Olivier Sessink | last post by:
Hi all, I want to make a value available to the global namespace of an embedded python interpreter. Several functions of the Python/C API feature a PyObject *globals and a PyObject *locals, so...
0
by: adamc | last post by:
hi, I'm currently debugging a crash occurring in the Python interpreter. I've got a Dictionary object in the form of a (PyObject *) I can cast it to (dictobject *) in the debugger watch...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
11
by: seberino | last post by:
Suppose a C extension locally built an array of PyObject* 's as follows... my_array = malloc(n * sizeof(PyObject*)); for (i = 0; i < n; i++) { my_array = PyList_New(0); } Q1: Must I do a...
0
by: Pradnyesh Sawant | last post by:
Hello, i have the following code: ################################################################# import time import sys from PyQt4 import QtGui, QtCore class Counter(QtCore.QThread): def...
1
by: Allen | last post by:
I have the PyObject pointers, and want to set different type of values to them. For example, INT8 nValue1 = 0; INT16 nValue2 = 1; FLOAT32 fValue = 1.0f; PyObject* var1 <= nValue1
1
by: MD | last post by:
Hi, I have a Python C extension which is passed a PyObject containing an integer value. Is it possible to change this same PyObject so that now the integer is of a different value? Thanks and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.