python3 super() new style autocompletion in PyCharm

Question:

With python3 we no longer need to explicitly set the parent class when calling super:

def __init__(self):
    super().__init__()

But it seems that PyCharm doesn’t know it, because when I try to autocomplete super for some method, it uses old style and I receive this:

def setUp(self):
    super(AutocompleteTestCase, self).setUp()

Is there any way to tell PyCharm to use new style, because I could not find one.
Editor -> General -> Code Completion doesn’t provide any way to add/override custom rules.

Asked By: Bohdan

||

Answers:

super live template is outdated in PyCharm (the corresponding ticket in PyCharm’s issue tracker).

I think you can edit it by hand in Preferences/Settings | Editor | Live Templates | Python | super.

enter image description here

Answered By: Pavel Karateev
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.