python-3.x - Python (ast module): id field of func: expr unknown
问题描述
Using ast
module in python, there is a report on call_node.func.id
saying that
Type of "id" is unknown (PylancereportUnknownMemberType)
Cannot access member "id" for type "expr" Member "id" is unknown (PylancereportGeneralTypeIssues)
call_node
is a Call
class in the module.
def check_inner_recursion(self):
for call_node in self.funccall:
if (self.func_def.name == call_node.func.id):
return True
I have tried looking at the fields of call_node.func
and these are the outputs
('id', 'ctx')
The purpose of this is to get the function name of the call. Is there any work around to the error?
解决方案
推荐阅读
- java - sun.audio.AudioPlayer,AudioStream 不会多次播放同一个声音文件
- xamarin - 如何使用 Xamarin.Forms MediaManager 库和 MVVM 播放 youtube 视频
- unit-testing - 如何实例化聚合以测试其他聚合?
- c# - itext PDF 链接在 Microsoft Edge 中不起作用
- android - 与 fontVariationSettings 相关的 Cordova 构建问题
- python-3.x - 在两个巨大的数据集中找到相同的值
- typescript - Typescript:至少实现一个特定接口的类
- javascript - How to handle dynamic image paths with webpack
- javascript - JavaScript Uglify 不同且正确?
- android - 如果使用 FLAG_LAYOUT_NO_LIMITS,则无法使用 setStatusBarColor 设置状态栏颜色