Python and Schools

Courageous jkraska at san.rr.com
Sat Apr 12 13:19:19 EDT 2003


>And then there is the self. It is not bad. It does not hurt your OO 
>programming. It's like the nipples of a beautifull girl turning into a 
>different color during intercourse. You think it's wired for the first 
>time. You wonder, why is this necessary.

Possibly it is necessary for the same reason that many coding standards
(such as in C++, using Microsoft's approach), one must put m_ before all
class member attributes. What that coding standard amounts to is an
example of the standards writer actually _fighting_ the existence of
implicit this in C++. In other words, they are using attribute-naming
to disambiguate between class attributes and local variables of the same
name. In Python, this problem does not exist, because "m_" is spelled
"self".

C//





More information about the Python-list mailing list