On 05/14/2017 01:53 AM, Brendan Barnwell wrote:
On 2017-05-13 21:07, Simon Ramstedt wrote:
Here are the pros and cons I could come up with for the proposed method:
(+) Simpler and more explicit.
I don't really see how that's simpler or more explicit. In one
respect it's clearly less explicit, as the "self" is implicit.
I cannot imagine that the average Python programmer would consider this to be simpler or more explicit than the current way of creating objects.
Some purists may argue in your favor, saying that by not having the _x attribute your code is more robust as you cannot accidentally change _x later and end up modifying how a method works.
I don't think this is worse. However, I do think it is unnecessary.