self
as the first argument PYL-E0213 50 super().__init__(*args, **kwargs)
51 self.bots.append(inner_self)
52
53 def run(inner_self): # noqa: N805 54 """Nothing to do here."""
55 inner_self.changed_pages = -47 # show that run was called
56
43
44 changed_pages = -42 # show that weird number to show this was used
45
46 def __init__(inner_self, *args, **kwargs): # noqa: N805 47 # Unpatch already here, as otherwise super calls will use
48 # this class' super which is the class itself
49 replace.ReplaceRobot = self._original_bot
The first argument of instance methods must be named self
. This is considered an error since this convention is so common that you shouldn't break it.
class Car:
def __init__(this, color):
this.color = color
def run(this):
print(f'I am a {this.color} car')
class Car:
def __init__(self, color):
self.color = color
def run(self):
print(f'I am a {self.color} car')