Unexpected Warning using Enum Functional API - PyCharm Bug(使用枚举函数 API 的意外警告 - PyCharm 错误)
问题描述
使用文档 8.13.12 中给出的功能 API 示例.我收到以下警告(使用 python 3.6).该代码确实在控制台中工作,但我宁愿在我的代码检查时没有警告.我究竟做错了什么?我怎样才能摆脱警告?
从枚举导入枚举Animal = Enum('Animal', 'ANT BEE CAT DOG')
<块引用>
意外的参数可能的被调用者:Enum.new(cls: Enum, value) object(self: object) less... (Ctrl+F1)检查信息:报告声明的参数和实际参数之间的差异,以及不正确的参数(例如重复的命名参数)和不正确的参数顺序.装饰器也被分析了
错误已修复 在 PyCharm 2020.1 中.
Using the Functional API example given in documentation 8.13.12. I get the following Warning (using python 3.6). The code does work in the console but I'd rather not have warnings upon my code inspection. What am I doing wrong? And how can I get rid of the warning?
from enum import Enum
Animal = Enum('Animal', 'ANT BEE CAT DOG')
Unexpected argument(s) Possible callees: Enum.new(cls: Enum, value) object(self: object) less... (Ctrl+F1) Inspection info: Reports discrepancies between declared parameters and actual arguments, as well as incorrect arguments (e.g. duplicate named arguments) and incorrect argument order. Decorators are analyzed, too
The bug was fixed in PyCharm 2020.1.
这篇关于使用枚举函数 API 的意外警告 - PyCharm 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用枚举函数 API 的意外警告 - PyCharm 错误


基础教程推荐
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 筛选NumPy数组 2022-01-01