by amardeep · 4y ago · 0 comments
For eg. reading about prebound methods here: https://python-patterns.guide/python/prebound-methods/. Seasoned python programmers probably wouldn't find anything interesting there, but for me, it was quite useful including instances of where it is being done in python standard library and discussion around when and when shouldn't it be used.
def some_random_function(self)
print(self.internal_state)
...
mymagicobject.func = some_random_func
mymagicobject.func() # -> prints the internal state of the object