Created
December 16, 2011 13:51
-
-
Save ssbarnea/1486122 to your computer and use it in GitHub Desktop.
pycharm-auto-complete-test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
class MyClass(): | |
def alpha(self): | |
pass | |
def beta(self): | |
pass | |
def getProxy(self): | |
"""This is description... | |
:return: MyClass -- bla bla | |
""" | |
return "" # imagine that here you have a function that returns you an XMLRPC proxy object of type MyClass | |
if __name__ == '__main__': | |
x = getProxy() | |
x.alpha() # this doen't AUTOCOMPLETE | |
x.capitalize() # this does autocomplete | |
@ssbarnea Types from docstrings already have precedence over inferred return types. Your type annotation just doesn't follow Sphinx annotation conventions.
The correct way of annotating this function in Sphinx is:
def getProxy(self):
"""This is description...
:return: bla bla
:rtype: MyClass
"""
return "" # imagine that here you have a function that returns you an XMLRPC proxy object of type MyClass
See also PY-7277.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This example is inspired from how xmlrpclib works.