Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible not to use "self" in a class? [duplicate]

Tags:

python

Possible Duplicate:
Python: How to avoid explicit 'self'?

In python class if I need to reference the class member variable, I need to have a self. before it. This is anonying, can I not use that but reference the class member?

Thanks. Bin

like image 722
Bin Chen Avatar asked Dec 21 '22 21:12

Bin Chen


1 Answers

No.

>>> import this
...
Explicit is better than implicit.
...
like image 163
Chris Morgan Avatar answered Dec 24 '22 11:12

Chris Morgan