autogenerate super() vs super(class, self)

Answered

Hi, I am a bit confused of the usage of the autogenerated super calls.
In Python2, you had to call super like this:

super(class, self).method()

This is also the way Pycharm autogenerates the super call. However, since Python3, we can also call super like this:

super().method()

which I consider as the better option as it makes the syntax a little simpler. However, PyCharm still uses the old syntax - is there any upside of doing that I do not know of?

1
2 comments

Yes, it is outdated and should be updated in PyCharm as well.

0

Hi,

There is an open issue in our tracker about that https://youtrack.jetbrains.com/issue/PY-26060, feel free to vote for it and comment.

Live Template can be changed manually in Preferences | Editor | Live Templates (File | Settings | Editor | Live Templates for Windows and Linux) as a workaround.

0

Please sign in to leave a comment.