[Tutor] OOP and Python.. a gentle remark

Simon Brunning simon at brunningonline.net
Wed Oct 25 11:40:25 CEST 2006

On 10/25/06, Asrarahmed Kadri <ajkadri at googlemail.com> wrote:
>  Why is it necessary to explicity use self argument in the class functions
> ?? I feel the language/interpreter should figure out which object has called
> the function? Isnt it ? (the use of 'self' keyword really confuses me. and
> to make matter worse the variables can be accessed from outside teh class.
> Isnt it a violation of the OOP principle of ENCAPSULATION)


> Also please let me know hwo can we declare PRIVATE VARIABLES in Python...??


Simon B
simon at brunningonline.net

More information about the Tutor mailing list