[docs] [issue28681] About function renaming in the tutorial

Vedran Čačić report at bugs.python.org
Sat Nov 19 00:19:37 EST 2016


Vedran Čačić added the comment:

Obligatory link: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ :-P
Yes, Python objects are simpler than people, but still not completely trivial. The core issue is "who does the calling".

Even one's native language might subtly (in Orwell sense) alter what they mean the name is. English question "What is your name?" is usually translated into Croatian (and some other Slavic languages) as "Kako se zoveš?", literally "how do you call yourself". In some other languages, it's "how should I call you". I think you agree those are three different concepts. And I think most disagreements between people in these discussions stem from those cultural differences. (Even people who consider English their native language might still have cultural differences, since English is spoken so widely.)

In Python, the most important distinction is "name as own identity"(1) vs "name as handle for calling"(2). Of course, we all know that each of these concepts have disadvantages, and as such, cannot serve completely. name(1) is not something all objects have (but e.g. functions and classes do), while name(2) is external to the object - each of existing namespaces might or might not have a way (or three, or infinitely many) to refer to it. And all those ways are not considered to be known to the object itself.

Since this concrete example speaks about names of functions defined with a def statement, those concepts coincide, and that's why some people have thought it speaks about name(1) and some others have thought it speaks about name(2). If we want to be completely honest, we should clarify that "name" is used in two ways, and that later text speaks only about name(2). But it might be too much for beginners. In that case, we should probably avoid mention name(1) sense until much later, and speak only of names as "name(2)".

----------
nosy: +veky

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28681>
_______________________________________


More information about the docs mailing list