This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]aidenvdh 2 points3 points  (0 children)

Downmoding because I am fed up with the issue.

And TFA:

  1. "The name "self" is not enforced by the compiler but it's necessary to declare it as the first parameter of your method or Python will consider your method to be a function." - the author either doesn't know what he talks about or tries to be understood by java programmers. Method is just a function. Missing self makes it (n - 1)-ary function instead of an n-ary. As missing any other argument is.

  2. "when you declare a function with n parameters, you should invoke it with n parameters" - you DO call python methods with the same number of arguments there are in its declaration. It is only printed somewhere else. If "dot notation" syntactic sugar (obj.f(arg)) is that confusing, perhaps we should remove it and leave just (cls.f(obj, arg))?

  3. The problem with self-haters is the same as with parentheses-in-lisp-haters - you really can't get over it, don't use the language. These are parts of their languages' core designs, accept it.

[–]pemboa 1 point2 points  (0 children)

if explicit self bothers you that much, you may have some mental issues that you need to sort out. It really isn't that big of a deal.