I find explicit self much easier to understand if i replace it in mymind with the word "instance"

F

frolib

I find explicit self much easier to understand if i replace it in my
mind with the word "instance". I know that using the word "self"
though is a strong convention.

Discuss please.
 
S

Steven D'Aprano

I find explicit self much easier to understand if i replace it in my
mind with the word "instance". I know that using the word "self" though
is a strong convention.

Discuss please.

There's nothing to discuss. Call it "self", "instance", "me" or "One" (as
in, One is not amused) in your own code, it's all the same. If you expect
others to read your code, then you are better off sticking to the usual
convention.
 
L

Lawrence D'Oliveiro

Steven said:
Call it "self", "instance", "me" or "One" (as in, One is not amused) in
your own code, it's all the same.

Earlier versions of the Python docs said that the name "self" was expected
by certain documentation-extraction tools. I can't find that statement any
more.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top