cpython/Objects/moduleobject.c


/* Module object implementation */

#include "Python.h"
#include "pycore_call.h"          // _PyObject_CallNoArgs()
#include "pycore_dict.h"          // _PyDict_EnablePerThreadRefcounting()
#include "pycore_fileutils.h"     // _Py_wgetcwd
#include "pycore_interp.h"        // PyInterpreterState.importlib
#include "pycore_long.h"          // _PyLong_GetOne()
#include "pycore_modsupport.h"    // _PyModule_CreateInitialized()
#include "pycore_moduleobject.h"  // _PyModule_GetDef()
#include "pycore_object.h"        // _PyType_AllocNoTrack
#include "pycore_pyerrors.h"      // _PyErr_FormatFromCause()
#include "pycore_pystate.h"       // _PyInterpreterState_GET()

#include "osdefs.h"               // MAXPATHLEN


#define _PyModule_CAST(op)


static PyMemberDef module_members[] =;


PyTypeObject PyModuleDef_Type =;


int
_PyModule_IsExtension(PyObject *obj)
{}


PyObject*
PyModuleDef_Init(PyModuleDef* def)
{}

static int
module_init_dict(PyModuleObject *mod, PyObject *md_dict,
                 PyObject *name, PyObject *doc)
{}

static PyModuleObject *
new_module_notrack(PyTypeObject *mt)
{}

static void
track_module(PyModuleObject *m)
{}

static PyObject *
new_module(PyTypeObject *mt, PyObject *args, PyObject *kws)
{}

PyObject *
PyModule_NewObject(PyObject *name)
{}

PyObject *
PyModule_New(const char *name)
{}

/* Check API/ABI version
 * Issues a warning on mismatch, which is usually not fatal.
 * Returns 0 if an exception is raised.
 */
static int
check_api_version(const char *name, int module_api_version)
{}

static int
_add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions)
{}

PyObject *
PyModule_Create2(PyModuleDef* module, int module_api_version)
{}

PyObject *
_PyModule_CreateInitialized(PyModuleDef* module, int module_api_version)
{}

PyObject *
PyModule_FromDefAndSpec2(PyModuleDef* def, PyObject *spec, int module_api_version)
{}

#ifdef Py_GIL_DISABLED
int
PyUnstable_Module_SetGIL(PyObject *module, void *gil)
{
    if (!PyModule_Check(module)) {
        PyErr_BadInternalCall();
        return -1;
    }
    ((PyModuleObject *)module)->md_gil = gil;
    return 0;
}
#endif

int
PyModule_ExecDef(PyObject *module, PyModuleDef *def)
{}

int
PyModule_AddFunctions(PyObject *m, PyMethodDef *functions)
{}

int
PyModule_SetDocString(PyObject *m, const char *doc)
{}

PyObject *
PyModule_GetDict(PyObject *m)
{}

PyObject*
PyModule_GetNameObject(PyObject *mod)
{}

const char *
PyModule_GetName(PyObject *m)
{}

PyObject*
PyModule_GetFilenameObject(PyObject *mod)
{}

const char *
PyModule_GetFilename(PyObject *m)
{}

PyModuleDef*
PyModule_GetDef(PyObject* m)
{}

void*
PyModule_GetState(PyObject* m)
{}

void
_PyModule_Clear(PyObject *m)
{}

void
_PyModule_ClearDict(PyObject *d)
{}

/*[clinic input]
class module "PyModuleObject *" "&PyModule_Type"
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3e35d4f708ecb6af]*/

#include "clinic/moduleobject.c.h"

/* Methods */

/*[clinic input]
module.__init__
    name: unicode
    doc: object = None

Create a module object.

The name must be a string; the optional doc argument can have any type.
[clinic start generated code]*/

static int
module___init___impl(PyModuleObject *self, PyObject *name, PyObject *doc)
/*[clinic end generated code: output=e7e721c26ce7aad7 input=57f9e177401e5e1e]*/
{}

static void
module_dealloc(PyObject *self)
{}

static PyObject *
module_repr(PyObject *self)
{}

/* Check if the "_initializing" attribute of the module spec is set to true.
 */
int
_PyModuleSpec_IsInitializing(PyObject *spec)
{}

/* Check if the submodule name is in the "_uninitialized_submodules" attribute
   of the module spec.
 */
int
_PyModuleSpec_IsUninitializedSubmodule(PyObject *spec, PyObject *name)
{}

int
_PyModuleSpec_GetFileOrigin(PyObject *spec, PyObject **p_origin)
{}

int
_PyModule_IsPossiblyShadowing(PyObject *origin)
{}

PyObject*
_Py_module_getattro_impl(PyModuleObject *m, PyObject *name, int suppress)
{}


PyObject*
_Py_module_getattro(PyObject *self, PyObject *name)
{}

static int
module_traverse(PyObject *self, visitproc visit, void *arg)
{}

static int
module_clear(PyObject *self)
{}

static PyObject *
module_dir(PyObject *self, PyObject *args)
{}

static PyMethodDef module_methods[] =;

static PyObject *
module_get_dict(PyModuleObject *m)
{}

static PyObject *
module_get_annotate(PyObject *self, void *Py_UNUSED(ignored))
{}

static int
module_set_annotate(PyObject *self, PyObject *value, void *Py_UNUSED(ignored))
{}

static PyObject *
module_get_annotations(PyObject *self, void *Py_UNUSED(ignored))
{}

static int
module_set_annotations(PyObject *self, PyObject *value, void *Py_UNUSED(ignored))
{}


static PyGetSetDef module_getsets[] =;

PyTypeObject PyModule_Type =;