Type hinting methods from module

Answered

Hello,

I am looking for a way for type hinting all methods from module or class.

For example, I have a unittest and in it I am loading classes from packages and modules.

Can I have a type hints in that test, which methods I can use from specific modules/classes?

(something similar to this: 

""" :type driver: appium.webdriver.Remote """

it hints me a methods from webdriver)

0
3 comments

Hello! Could you please clarify the case on your screenshot, do you want to get type hinting for "load_page" method?

0
Avatar
Permanently deleted user

No, I am looking for a way to have type hinting for methods that are in the whole module or even package, for example in Modules.CameraPage.

(method load_page is dynamically loading a class based on string)

0
Avatar
Permanently deleted user

PyCharm supports type hints defined in PEP 484, including type hints for variables and type hints in comments for Python 2 and 3. You might find these type hints applicable to your case.

0

Please sign in to leave a comment.