PyCharm: Call to __init__ of super class is missed
已回答
In the following code, the inspector on PyCharm Pro 2018.3.2 shows a warning at line 11 that "Call to __init__ of super class is missed".
#! /usr/bin/python3
from abc import ABC, abstractmethod
class Foo(ABC):
@abstractmethod
def __init__(self):
pass
class Bar(Foo):
def __init__(self):
_b = 'b'
Indeed, the initializer of the Foo class is missed when initalizing an instance of the Bar class, on purpose. Why is this a warning? I'm learning about Python classes and inheritance, and this warning has me very confused. What should be the syntax if one wants to override the parent's initializer?
请先登录再写评论。
Hi,
I think this issue is relevant. Please vote for it and follow for updates.
Actually, I created another one for your problem https://youtrack.jetbrains.com/issue/PY-33265
Voted for the new issue. Thanks Sergey!
-Hector
I have this issue still on 2019.2 on ubuntu.