Re: Creating custom types from C code

2010-12-20 Thread Eric Frederich
Thanks for the reply. I remember reading about named tuples when they were back-ported to the 2.X series but I never played with them. Is there a way to instantiate a named tuple from C code? Maybe I'm over-thinking this whole thing. Is there a simple way that I can define a class in Python and

Re: Creating custom types from C code

2010-12-20 Thread Stefan Behnel
Eric Frederich, 20.12.2010 16:23: I remember reading about named tuples when they were back-ported to the 2.X series but I never played with them. Is there a way to instantiate a named tuple from C code? There isn't a dedicated C-API for named tuples, but you can instantiate any Python type

Creating custom types from C code

2010-12-17 Thread Eric Frederich
Hello, I have an extension module for a 3rd party library in which I am wrapping some structures. My initial attempt worked okay on Windows but failed on Linux. I was doing it in two parts. The first part on the C side of things I was turning the entire structure into a char array. The second

Re: Creating custom types from C code

2010-12-17 Thread Stefan Behnel
Eric Frederich, 17.12.2010 23:58: I have an extension module for a 3rd party library in which I am wrapping some structures. My initial attempt worked okay on Windows but failed on Linux. I was doing it in two parts. The first part on the C side of things I was turning the entire structure into