5 ms·
From that link: > There's no way without knowing what the decorator does whether to endow the method being defined with an implicit 'self' argument or not. Ho
by falsedan 9y ago
From that link:
> 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".
> But compared to which languages?
Plain python.
- icebraining 9y agoHow 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.
- falsedan 9y ago> That would add complexity to the implementation 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?)