Access modifiers
-
Instead fo strict keywords like
public,private,protectedPython uses naming conventions to indicate the scope of variables and methods -
By default, all the members in python class are public
-
The reason python doesn’t force the rules is
We are all consenting adults here -
Conventions
| Access Level | Convention | Accessibility |
| ———– | ———- | ————- |
| Public | var | Accessed from anywhere |
| Protected | _var | Intended for internal use (convention only) |
| private | __var | Internal usel triggers name mangling to prevent accidental usage|
Properties in Python Classes
-
Refer Here for the docs
-
Refer Here for the notebook
Proxy-Pattern
- Proxy is a class that acts as a stand-in or place holder for another object
- Refer Here for the sample proxy.
