title: Parameter type definition in function of attribute Python
body: <p>i am working as a TEA, i use Python + Selenium Webdriver and Behave to run my tests.</p>
  <p>For this i define the webdriver inside the context as follows</p>
  <pre><code>    driver = webdriver.Chrome()
      driver.implicitly_wait(5)
      context.driver = driver
      context.driver.get('https://www.ebay.com/')
  </code></pre>
  <p>This is defined in one function, but my problem is that when I want to use the driver in another step function i don't get the snippets for the the functions of driver. This makes me lose a lot of time looking what's the exact name of the function I am trying to use.</p>
  <p>For example</p>
  <pre><code>@then('Click the &quot;Search&quot; button')
  def step_impl(context: behave.runner.Context):
      &quot;&quot;&quot;
      :type context: behave.runner.Context
      &quot;&quot;&quot;
      search_btn = context.driver.find_element_by_xpath('//*[@id=&quot;gh-btn&quot;]')
      search_btn.click()
  
  </code></pre>
  <p>I know I can define the type of the parameter received directly like</p>
  <p>var_name: str <code>(def step_impl(context: behave.runner.Context)</code>, but the case I am looking for is more specific. like context.driver: 'webdriver object'</p>
  <p>Is there a way to define the context.driver type so my ide will interpret that this is a webdriver object and in that way get the methods of the driver?</p>
  <p>I am using PyCharm Professional</p>