Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试解析一个布尔值和一个可选的 unicode 字符串(仅当布尔值为 True 时才应设置)。
PyObject *pBool, *pStr;
PyArg_ParseTuple(args, "O!|u", &PyBool_Type, pBool, pStr);
当我这样调用我的函数时: func(True, u'str'); func(False);
func(True, u'str');
func(False);
我的代码崩溃了。
我究竟做错了什么?