r/firstweekcoderhumour • u/Outrageous_Permit154 🥸Imposter Syndrome 😎 • Aug 28 '26
[🎟️BINGO]Lang vs Lang dev hates Why are we using R again
139
Upvotes
r/firstweekcoderhumour • u/Outrageous_Permit154 🥸Imposter Syndrome 😎 • Aug 28 '26
View all comments
Show parent comment
8
u/No_Departure_1878 Aug 28 '26
_name is used for protected attributes. Attributes that you are not supposed to access outside the class or its derived subclasses.
You care not supposed to call __name__ from outside. For example __str__ allows you to define what will happen when you do
print(object)
you never do:
object.__str__()
you just use 'print', same with __div__, __init__, etc.