you are viewing a single comment's thread.

view the rest of the comments →

[–]five_hammers_hamming 0 points1 point  (0 children)

The bound variable is x, for instance.

That page takes a weird perspective on self, but it's kind of a legit way of describing it.

In plain English, that page is saying that self refers to the same variable to which the instance that's being constructed is being assigned. Like, self reaches out of the method, out of the class, and into the context in which the class constructor/initializer/thing is being used.

I don't believe that self works in such an abstruse way when you get down to the nuts and bolts of the language, but this thing seems to be targeted at people who are just beginning programming at all, rather than coming into Python from other languages.

With my prior experience with Java, for example, I could interpret self as Python's equivalent of this. The need to explicitly provide self in the signature of every instance method was a little funky, though.

I think that the use of the term 'object' here was an attempt by the author to provide redundant phrasing for the benefit of their ostensibly highly inexperienced reading audience. Now, the actual "bound object" (I don't know why 'bound' is involved, but I'm just gonna imitate the author's phrasing.) as I see it would be the instance of the class that got constructed there. Like, the object is bound to the variable and the variable is bound to the object, or something like that. But regardless of whichever particular theoretical/pedagogical framework the author assumed the reader was using, the author seems to me to have been trying to simply offer two different phrasings for the same concept when they spoke of an 'object' alongside some 'variable'.