我想在我的项目中引入部分类型注释。例如过载。我发现pep561引入了部分存根文件支持。在
我用PyCharm开发我的项目,并添加相应的*.pyi
文件。得到了预期的信息,但是PyCharm报告在pyi文件中找不到引用。在
当pyi文件中没有条目时,是否可以强制PyCharm查找原始py文件?或者它也可以用类的部分条目来实现?在
├── main.py
└── pep561_test
├── __init__.py
└── __init__.pyi
在主.py在
^{pr2}$初始值
class AA:
def test1(self, a):
pass
def test2(self, a):
pass
class BB:
def test1(self, a):
pass
def test2(self, a):
pass
class CC:
def test1(self, a):
pass
def test2(self, a):
pass
你的初始化
class AA:
def test1(self, a: int) -> int: ...
def test1(self, a: bool) -> str: ...
def test2(self, a):
pass
class BB:
def test1(self, a):
pass
目前没有回答
相关问题 更多 >
编程相关推荐