Created
August 12, 2020 08:57
-
-
Save DarkSuniuM/1aee29da022df1b82ce026d31425309c to your computer and use it in GitHub Desktop.
Python DocStrings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Python DocStrings Tutorial.""" | |
def my_function(): | |
"""Do nothing and return None.""" | |
return None | |
class MyClass: | |
""" | |
My Class. | |
Just an example. | |
""" | |
# `object` in Python has a special attribute called "__doc__", | |
# which gives us access to the object's docstring | |
print(__doc__) | |
print(my_function.__doc__) | |
print(MyClass.__doc__) | |
# Checkout the video at YouTube: | |
# https://youtu.be/krwObdp5QIA | |
# | |
# Don't forget to like and subscribe! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment