Pycharm提示MyClass实例的意外参数。有没有解决的办法?
import attr
@attr.s
class _Super:
""" My Super class"""
x: str = attr.ib(validator=attr.validators.instance_of(str))
@attr.s
class MyClass(_Super):
""" My Sub class"""
y:str = attr.ib(validator=attr.validators.instance_of(str))
x = MyClass(x="a", y="b") # (x variable) Pycharm Typehint: "Unexpected argument"
最佳答案
这是PyCharm 2018.2中的错误
https://youtrack.jetbrains.com/issue/PY-28506