Yes, self
is passed implicitly when you call the method of an instance and default arguments need not always be specified with their names(if passed in the correct order). On a side note python 3 allows you to use the asterisk (*
) to make sure that you pass them with their names:
>>> def foo(*, text=''):
pass
>>> foo('aa')
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
foo('aa')
TypeError: foo() takes 0 positional arguments but 1 was given
>>>
>>> foo(text='aaa')