In other languages, you can apply context to function, so you can have the context scope.
The similar thing I couldnt find relative reference for Python.
In below example, if I wana access context scope from outside, what can I do??
On below example, how can I access the class private method from outside function?
Relative example :
- JS : https://www.w3schools.com/js/js_function_apply.asp
- Php : Equivalent of Function.prototype.apply in PHP?
- Kotlin : https://kotlinlang.org/docs/scope-functions.html
class a:
def __b(S):
print(11111)
def c(S):
d(S) # how can I apply scope here??
---
def d(S):
S.__b()
---
a().c()
Thank you very much.