任意元组上的PyArg_ParseTuple() [英] PyArg_ParseTuple() on arbitrary tuples

查看:122
本文介绍了任意元组上的PyArg_ParseTuple()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关此问题的确认信息

I am looking for confirmation on this issue:

我可以在任何Python元组上使用PyArg_ParseTuple(),还是仅在函数调用中作为参数列表传递的那些上使用PyArg_ParseTuple()?

Can I use PyArg_ParseTuple() on any Python tuple, or just on those passed as argument lists from function calls?

我看到前者的强烈暗示,但就我而言,文档在这一点上含糊不清,因此在这里是我的问题.

I see strong indication for the former, but to my reading the documentation is rather vague on this point, hence my question here.

推荐答案

唯一的问题是,如果在分析元组时发生错误,则错误消息将适合函数调用.

The only problem is that the error messages, if an error occurs while parsing the tuple, will be appropriate to a function call.

否则,它应该适用于任意元组以及参数列表.

Otherwise, it should work on arbitrary tuples just as well as on argument lists.

这篇关于任意元组上的PyArg_ParseTuple()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆