test if PyObject * points to real python object

Discussion in 'Python' started by David McNab, Jun 19, 2004.

  1. David McNab

    David McNab Guest

    Hi,

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

    --
    Cheers
    David
     
    David McNab, Jun 19, 2004
    #1
    1. Advertising

  2. 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
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Jun 21, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nikolai Kirsebom

    Getting C++ object from PyObject *

    Nikolai Kirsebom, Sep 25, 2003, in forum: Python
    Replies:
    1
    Views:
    903
    Erwin S. Andreasen
    Sep 28, 2003
  2. Olivier Sessink
    Replies:
    0
    Views:
    413
    Olivier Sessink
    Feb 24, 2005
  3. Replies:
    6
    Views:
    391
    Bruclee
    Dec 10, 2008
  4. DanielJohnson
    Replies:
    7
    Views:
    2,042
    James Kanze
    Jan 17, 2009
  5. Replies:
    4
    Views:
    657
    Gabriel Genellina
    Jan 26, 2009
Loading...

Share This Page