python3 ctypes 的 结构体定义中,怎么引用自身?

川一八 川一八 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我这么使用时提示说“找不到Sentence_link”

```
class Sentence_link(ctypes.Structure):
_fields_= [("para_idx", ctypes.c_ulong), ("sent_idx", ctypes.c_ulong),("sent_init",ctypes.c_int),("msg_buff",ctypes.c_char_p), ("next",ctypes.POINTER(Sentence_link))]
```
```
_fields_= [("para_idx", ctypes.c_ulong), ("sent_idx", ctypes.c_ulong),("sent_init",ctypes.c_int),("msg_buff",ctypes.c_char_p), ("next",ctypes.POINTER(Sentence_link))]
NameError: name 'Sentence_link' is not defined

```
请问该如何引用自身?


...全文
评论 2
收藏 已收藏
分享
返回顶部