1 Star 0 Fork 19

Madision-Jack/python

forked from OpenHarmony-SIG/python
关闭
 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
moduleobject.c.h 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
bayanxing 提交于 2021-10-22 16:55 +08:00 . python3.8 for openharmony l2
/*[clinic input]
preserve
[clinic start generated code]*/
PyDoc_STRVAR(module___init____doc__,
"module(name, doc=None)\n"
"--\n"
"\n"
"Create a module object.\n"
"\n"
"The name must be a string; the optional doc argument can have any type.");
static int
module___init___impl(PyModuleObject *self, PyObject *name, PyObject *doc);
static int
module___init__(PyObject *self, PyObject *args, PyObject *kwargs)
{
int return_value = -1;
static const char * const _keywords[] = {"name", "doc", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "module", 0};
PyObject *argsbuf[2];
PyObject * const *fastargs;
Py_ssize_t nargs = PyTuple_GET_SIZE(args);
Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE(kwargs) : 0) - 1;
PyObject *name;
PyObject *doc = Py_None;
fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 2, 0, argsbuf);
if (!fastargs) {
goto exit;
}
if (!PyUnicode_Check(fastargs[0])) {
_PyArg_BadArgument("module", "argument 'name'", "str", fastargs[0]);
goto exit;
}
if (PyUnicode_READY(fastargs[0]) == -1) {
goto exit;
}
name = fastargs[0];
if (!noptargs) {
goto skip_optional_pos;
}
doc = fastargs[1];
skip_optional_pos:
return_value = module___init___impl((PyModuleObject *)self, name, doc);
exit:
return return_value;
}
/*[clinic end generated code: output=680276bc3a496d7a input=a9049054013a1b77]*/
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/madision/python.git
git@gitee.com:madision/python.git
madision
python
python
master

搜索帮助