I tried to create a python shell for the tk extension, so I looked at Tkinter.py to find out how to do this.
When I looked at this file, I found that the following pattern appears many times: the internal method (indicated by the leading "_" in the method name) is defined, then the public method is defined only as an internal method.
I want to know what is the use of this.
For example, in the code for the Misc class:
def _register(self, func, subst=None, needcleanup=1):
# doc string and implementations is removed since it not relevant
register = _register
Thanks.
source
share