title: Meta data for PyModule_Create
body: <p>In Python-2.7 the function <a href="https://docs.python.org/2.7/c-api/allocation.html#c.Py_InitModule4" rel="nofollow noreferrer">Py_InitModule4</a> had an <strong>experimental</strong> feature.</p>
  
  <pre><code>PyObject* Py_InitModule4(char *name, PyMethodDef *methods, char *doc, PyObject *self, int apiver);
  </code></pre>
  
  <p>The documentation says:</p>
  
  <blockquote>
    <p>If self is non-NULL, it <strong>will be passed to the functions</strong> of the module
    as their (otherwise NULL) <strong>first parameter</strong>. (This was added as an
    experimental feature, and there are no known uses in the current
    version of Python.)</p>
  </blockquote>
  
  <p>Sadly they didn't ask me - I used it ;-). So the <code>self</code> argument was passed to all functions which were defined in PyMethodDef. I used this feature in my embedded environment to pass a structure to my functions. This feature doesn't seem to exist anymore in Python 3, instead <code>self</code> is now of type <code>PyModuleType</code>. Any other way how I can tunnel data to my functions, preferably without using other functions from the Python C API.</p>
  
  <pre><code>static PyObject * MyCustomFunction(PyObject *self, PyObject *args, ...)
  // In Python 2 self could be set via Py_InitModule. What is the way to go in Python 3?
  </code></pre>