Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'll agree with this entirely. As a newcomer to Python, I found the explicit "self" argument to be confusing. And now I just find it irritating. It breaks convention with every other OO language; it's additional meaningless noise in method definitions; and most importantly it violates the convention used by nearly every other programming language I'm aware of, which is that method definition argument lists and method call argument lists should match up.

When method call argument one is method definition argument two, things get confusing quickly. What's the benefit to readability? Python has plenty of other implicit rules (semantic whitespace being the most troublesome--though ironically its primary benefit of readability runs counter to the visual noise of the explicit self arg), and as pak points out, explicit "self" in the method def just moves the implicitness elsewhere in the code.



I like the explicit self. It makes the language much simpler, clearer and less "magic".


> It breaks convention with every other OO language

Lua, Go, and Rust all have explicit self.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: