Re: PyCheck for a classes defined in python and user data in PyObject_HEAD
- From: sndive@xxxxxxxxx
- Date: Fri, 02 Nov 2007 01:13:35 -0000
On Nov 1, 4:14 pm, snd...@xxxxxxxxx wrote:
q#1:
in C I want to check if a given PyObject is a xml.dom.minidom.Node (or
a derivative).
how do i extract a PyTypeObject for such a class?
nevermind, i found an instance object that will work for me
as long as i figure out where is the documentation
beyond this:
http://docs.python.org/api/instanceObjects.html
on the data attrib access and extracting PyClassObject from it.
issue #2
I'm in a situation when i don't really need to extend python with any
classes of my own but
i do have extra luggage for the python data structures such as tuples,
lists, dictionaries, etc
on the c++ side. I see no place in PyObject_HEAD where i can stick a
void* to my extra data.
If i enter a feature request into bugzilla for python do you think it
will be well received?
#ifdefed of course like the prev/next extras.
I'm surprised noone else is using evil twin approach.
The reason i'm asking is because while for dictionaries i can stick
weak pointer back to my c++
object in a key with an obscure name while in lists this would change
the list size and thus
is obviously not as easy to "hide" from the client code.
a placeholder in a pyobject would've been of help here
.
- Follow-Ups:
- Re: PyCheck for a classes defined in python and user data in PyObject_HEAD
- From: Gabriel Genellina
- Re: PyCheck for a classes defined in python and user data in PyObject_HEAD
- References:
- Prev by Date: (MAC) CoreGraphics module???
- Next by Date: ValueError: invalid \x escape
- Previous by thread: PyCheck for a classes defined in python and user data in PyObject_HEAD
- Next by thread: Re: PyCheck for a classes defined in python and user data in PyObject_HEAD
- Index(es):
Relevant Pages
|