I am new to Python and I was printing the __doc__
of various built-in Python methods. Then I tried to do the following:
for f in dir(__builtins__):
print('********' + f + '********\n', f.__doc__)
I was surprised when the result of this looked something like this:
********abs********
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
********all********
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
********any********
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
********ascii********
str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
After doing some research, I found this, but I still didn't see how I could do what I was hoping to accomplish. I know that this is seamlingly pointless, but I feel it will be useful for me to understand how to dynamically execute tasks similar to this in Python.
Thank you for the help!