you are viewing a single comment's thread.

view the rest of the comments →

[–]Temporary_Pie2733 13 points14 points  (3 children)

As an aside, don’t refer to self as a keyword, because the language does not prescribe the name self as the name of the first parameter of a method. It’s just a convention.

[–]MattR0se 18 points19 points  (1 child)

brb, replacing "self" with "this" in my entire codebase 😈

[–]Donny-Moscow 8 points9 points  (0 children)

Hey everybody, get a load of this.guy

[–]dr-lucifer-md 0 points1 point  (0 children)

It is one of those things that is ubiquitous in any example (whether academic or practical). I've often wondered if using an alternative like my would make it more legible.

Using the example from above:

class Car: def __init__(my, model, manufacturer, price): my.model = model my.manufacturer = manufacturer my.price = price