[Python-Dev] Anyone have a Universal setter example? (original) (raw)
Robert Steckroth robertsteckroth at gmail.com
Fri Oct 26 23:01:09 CEST 2012
- Previous message: [Python-Dev] Python 3.3 vs. Python 2.7 benchmark results (again, but this time more solid numbers)
- Next message: [Python-Dev] Anyone have a Universal setter example?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello Gang, I am fresh to this list so, hello PYC gurus!
I have been getting into the Python C API over the past few days and found it it to be a wonderful framework with a solid design. There are many questions I would like to pose and answer in this community and look forward to a productive relationship. Here are a few question I have:
Is it appropriate to post usage questions regarding the Python C API to this list like the questions below?
Is there any examples of a universal setter function for
PyGetSetDef
? The docs mention using the closure pointer from the last element in thePyGetSetDef
structures. I am finding it hard to get a grasp on how this is implemented. I understand why we use it and what it does and need a more modular setter function for a large object.
From the docs [http://docs.python.org/extending/newtypes.html]
The getter function is passed a Noddy object and a “closure”, which is void pointer. In this case, the closure is ignored. (The closure supports an advanced usage in which definition data is passed to the getter and setter. This could, for example, be used to allow a single set of getter and setter functions that decide the attribute to get or set based on data in the closure.)
- Is it customary to use header files when building larger Python modules/objects? I was successful in prototyping the source files, but unable to get the module working after running a distutils install. In short, is it encouraged to use header files?
-- Bust0ut, Surgemcgee: Systems Engineer --- surgemcgee.com Django_Teamplate3d
- Previous message: [Python-Dev] Python 3.3 vs. Python 2.7 benchmark results (again, but this time more solid numbers)
- Next message: [Python-Dev] Anyone have a Universal setter example?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]