Skip to content

Instantly share code, notes, and snippets.

@DarkSuniuM
Created August 12, 2020 08:57
Show Gist options
  • Save DarkSuniuM/1aee29da022df1b82ce026d31425309c to your computer and use it in GitHub Desktop.
Save DarkSuniuM/1aee29da022df1b82ce026d31425309c to your computer and use it in GitHub Desktop.
Python DocStrings
"""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