super is given the class and instance that Python 3 fills in on its own
What it finds
In a method, super().method() finds the class and the instance by itself; super(Child, self) repeats them, and goes wrong silently when the class is renamed or the method is copied to another class. Reported are calls of the builtin super with the enclosing class and the method's first parameter as arguments. The fix removes them; it is safe.
From the rule's source, explicit_super_arguments.rs.
class Child(Base): def __init__(self, x): super(Child, self).__init__(x)tx0 reports: super() finds the class and instance on its own super(Base, self).__init__(x) super().__init__(x) Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/python:explicit-super-arguments" = "note"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:explicit-super-arguments] reason="..."tx0 explain tx0/python:explicit-super-arguments shows the same in the terminal. Found a false positive? Report it.