Last Site Update: 16 July 2014 | Latest Version: 3.6.0


Main

Download

Screenshots

Manual

Developers

About/Contact


PyDev Appcelerator




Previous (Auto-suggest keywords) Root Next (Debugger)


Code Completion

Type hinting with docstrings/comments

New on PyDev 2.8.0

It's possible to provide hints for code-completion with docstrings by commenting types with the Sphinx/Epydoc format.

Below are some examples of how to provide type-hints.

Return type with Sphinx

class MyClass:

    def method(self):
        ':rtype unittest.TestCase'

Parameter type with Sphinx

class MyClass:

    def method(self, a):
        ':type a: TestCase'
        #Note that just the class name is accepted, but in this case,
        #it'll search for a TestCase class in the whole workspace

Parameter type with Sphinx inline

class MyClass:

    def method(self, a):
        ':param TestCase a:'

Local variable with Sphinx

class MyClass:

    def method(self, lst):
        #Can be on the same line
        for a in lst: #: :type a: GUITest
            a.;

Local variable with Sphinx

class MyClass:

    def method(self, lst):
        #Or on the line before
        #: :type a: GUITest
        for a in lst:
            a.;

Local variable with Sphinx

class MyClass:

    def method(self, lst):
        #If commented as a docstring must be on the
        #line after
        for a in lst:
            ': :type a: GUITest'
            a.;

Return type with Epydoc

class MyClass:

    def method(self):
        '@rtype unittest.TestCase'

Parameter type with Epydoc

class MyClass:

    def method(self, a):
        '@type a: TestCase'
        #Note that just the class name is accepted, but in this case,
        #it'll search for a TestCase class in the whole workspace




Previous (Auto-suggest keywords) Root Next (Debugger)
PyDev development

PyDev is open source and depends on your contributions! This may be in the form of bug fixes, answers on stackoverflow, new features... Another option is financially supporting it (PayPal):



Corporate sponsorship is available for companies.



Search PyDev-related content







Copyright: Appcelerator, Inc. 2008-2014