【发布时间】:2019-09-25 18:58:15
【问题描述】:
我有两个类,分别是 A 和 B。B 在其构造函数 A 作为参数。 A 类有一个函数 foo。现在当我输入“a”时。我希望 Vs 代码自动完成以显示建议“a.foo()”。它目前不工作。我需要输入提示或类似的东西吗?我尝试导入 A 但它不起作用。
class A:
def __init__(self):
def foo(self):
print("hello")
class B:
def __init__(self, a):
a. <-- this should show the members of A but does not
运行 Mac 和带有 Microsoft 扩展的 Python 2.7。
【问题讨论】:
-
你能显示一个示例代码吗
-
修复了! @杰里尔
标签: python class parameters visual-studio-code autocomplete