python - CPython 中的 _PyObject_GetAttrId() 是什么?
问题描述
我在 CPython 中查看了 sysmodule.c 并遇到了这段代码stdin_encoding = _PyObject_GetAttrId(fin, &PyId_encoding);
,但我找不到它的任何文档。
是什么_PyObject_GetAttrId()
?
https://github.com/python/cpython/blob/master/Python/sysmodule.c#L597
解决方案
我的假设是它是 python__getattr__
魔术方法的实现。
查看此魔法方法列表以获取更多信息。
推荐阅读
- selenium - QAF - 如何使用 QAF 自动化 WEB 和 MOBILE 应用程序
- javascript - 为什么 JSON 数据在 JavaScript 中显示“未定义”?
- javascript - JavaScript - 创建具有多级数组支持的 deepSet()
- javascript - Formik 嵌套初始值、表单字段名称和点表示法?
- java - 我有两个代表长数字的列表,我需要找到一种递归方式来回答哪个数字更大
- mysql - Lambda - MYSQL -RDS RDS 代理 ETIMEOUT 错误
- java - 通过 Okhttp 客户端连接到 Tor 网络的问题
- ios - iOS 上的语音备忘录文件是什么内容类型?
- mysql - 获取特定日期范围内每个月的行数
- java - Java/Spring -> 如何构造(设计模式)同一进程中涉及的多个类之间的关系