_2qx9q
Last Updated: February 25, 2016
·
172
· prudnikov

How to tell PyCharm what is the type of the variable

def any_function_or_method(some_item):
    assert isinstance(some_item, SomeItem)
    # Now type `some_item.` 

An assert line here will tell PyCharm the type of some_item variable and use this information for autocomplete suggestions.

Say Thanks
Respond