That's not an hack, it's a conscious decision[1]. It actually avoids having to implement hacks, in the case of decorators; for example, @classmethod and @staticmethod can be implemented in pure Python thanks to that. It also avoids all the crap that litters JavaScript code, like "var self = this" and bind(), since you can just use different names to those variables.
Implicit "this" works in Java and similar because the language is so restricted anyway that an explicit version would be useless.
and don't distinguish between initialization & construction.
Fair enough, but are they able to do what __new__ does?
This is the part I disagree with. So much python I read in apps, libraries, web frameworks, and pythonista tweets is needlessly clever.
> There's no way without knowing what the decorator does whether to endow the method being defined with an implicit 'self' argument or not.
How about letting the code object decide if it's a method or a function, using a meta-object protocol to track when a code object is a method? Frankly, Guido's arguments boil down to "I can't see a nice way to not have it", not "here's a good reason to prefer this style".
How about letting the code object decide if it's a method or a function, using a meta-object protocol to track when a code object is a method? Frankly, Guido's arguments boil down to "I can't see a nice way to not have it", not "here's a good reason to prefer this style".
That would add complexity to the implementation and use to solve a specific problem, while leaving others unsolved. In any case, disagreeing with a decision doesn't make it a hack.
Plain python.
Fine, but I think the claim is that Python's culture avoids being overly clever compared to the culture of languages that offer similar possibilities. Being overly clever in your personal view is inherently subjective and therefore unarguable.
That's the job of a good language: to move the necessary complexity to the core, so users of the language do not have to address it by being clever.
> Being overly clever in your personal view is inherently subjective and therefore unarguable
non sequitur: I write the most boring plain python that can get the job done. I see other prolific python devs reveling in writing obtuse code (probably as jokes? frustrated standup comics?)
>> There is something of a culture in Python of not being overly clever
>This is the part I disagree with. So much python I read in apps, libraries, web frameworks, and pythonista tweets is needlessly clever.
Can you give some examples? I'm not saying you're right or wrong, would just like to see some.
How is the OO layer a clever hack?