How to get PyCharm to auto-complete code in methods? How to get PyCharm to auto-complete code in methods? python python

How to get PyCharm to auto-complete code in methods?


You can use type hints: http://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html

 def some_method(self, conn):   """   @type conn: EC2Connection   """   conn.<autocomplete>


You can specify the type information about the parameters of the function using Python 3 parameter and return value annotations. If you're using Python 2, you can also specify information in the function's docstring. PyCharm understands the format used by docstrings of binary modules in the standard library, for example:

"""foo(int, string) -> listReturns the list of something"""


In order for PyCharm to recognize an instance of an object and retrieve all its methods, we have to use the following statements. But I think that both is a terrible way of wasting programming and run time.

assert isinstance(instanceX, ClassOfInstanceX)  instanceX.{#list of method/properties appears}

Alternatively, you can also use the class name will recall the method or property everytime you want to invoke it and pass in the instance to the self parameter. But this is too verbose, for my liking, esp for nested class

ClassOfInstanceX.{#list of method/properties appears}     # then you will have...ClassOfInstance.method(instanceX, args...)