Comment

Comment by progval

> The nuisance of having to add self as parameter to every class method

This was done intentionnaly, because "Explicit is better than implicit". It also has some uses, eg. if you want to do this:

    class Foo:
        def inject_bar(self):
            def new_bar(self2):
                pass # you can refer to both 'self' and 'self2 here
            other_object.bar = new_bar
It's rare, but it has its uses.
parent progval 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton