• Home
  • Raw
  • Download

Lines Matching refs:module

8 .. index:: object: module
10 There are only a few functions special to module objects.
15 .. index:: single: ModuleType (in module types)
17 This instance of :c:type:`PyTypeObject` represents the Python module type. This
23 Return true if *p* is a module object, or a subtype of a module object.
31 Return true if *p* is a module object, but not a subtype of
40 single: __name__ (module attribute)
41 single: __doc__ (module attribute)
42 single: __file__ (module attribute)
44 Return a new module object with the :attr:`__name__` attribute set to *name*.
45 Only the module's :attr:`__doc__` and :attr:`__name__` attributes are filled in;
49 .. c:function:: PyObject* PyModule_GetDict(PyObject *module)
51 .. index:: single: __dict__ (module attribute)
53 Return the dictionary object that implements *module*'s namespace; this object
54 is the same as the :attr:`~object.__dict__` attribute of the module object. This
57 manipulate a module's :attr:`~object.__dict__`.
60 .. c:function:: char* PyModule_GetName(PyObject *module)
63 single: __name__ (module attribute)
66 Return *module*'s :attr:`__name__` value. If the module does not provide one,
70 .. c:function:: char* PyModule_GetFilename(PyObject *module)
73 single: __file__ (module attribute)
76 Return the name of the file from which *module* was loaded using *module*'s
81 .. c:function:: int PyModule_AddObject(PyObject *module, const char *name, PyObject *value)
83 Add an object to *module* as *name*. This is a convenience function which can
84 be used from the module's initialization function. This steals a reference to
90 .. c:function:: int PyModule_AddIntConstant(PyObject *module, const char *name, long value)
92 Add an integer constant to *module* as *name*. This convenience function can be
93 used from the module's initialization function. Return ``-1`` on error, ``0`` on
99 .. c:function:: int PyModule_AddStringConstant(PyObject *module, const char *name, const char *valu…
101 Add a string constant to *module* as *name*. This convenience function can be
102 used from the module's initialization function. The string *value* must be
107 .. c:function:: int PyModule_AddIntMacro(PyObject *module, macro)
109 Add an int constant to *module*. The name and the value are taken from
110 *macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int
111 constant *AF_INET* with the value of *AF_INET* to *module*.
116 .. c:function:: int PyModule_AddStringMacro(PyObject *module, macro)
118 Add a string constant to *module*.