将一个类的对象传递给另一个对象python,但无法从此类访问所有方法

问题描述 投票:0回答:1

我在班级A中有此代码:

self.driver = WebDriver.remove();

而且我可以正常访问驱动程序的方法:

self.driver.launchApp()

但是当我将此驱动程序传递给另一个不同类的方法时

executeTest.execute(driver); 

现在在B类中定义了此execute方法的所有方法都无法访问,例如

driver.launchApp()

无效

python appium appium-android appium-ios python-appium
1个回答
-1
投票

这在Python中实际上是不可能的。 You can do it,但您绝对不应该。

© www.soinside.com 2019 - 2024. All rights reserved.