Skip to content

Instantly share code, notes, and snippets.

@arukavina
Created April 14, 2018 18:53
Show Gist options
  • Save arukavina/54c7aa7613253de7e2207c02e8216d6e to your computer and use it in GitHub Desktop.
Save arukavina/54c7aa7613253de7e2207c02e8216d6e to your computer and use it in GitHub Desktop.
Python Inner Comments
g = 'module attribute (module-global variable)'
"""This is g's docstring."""
class AClass:
c = 'class attribute'
"""This is AClass.c's docstring."""
def __init__(self):
"""Method __init__'s docstring."""
self.i = 'instance attribute'
"""This is self.i's docstring."""
def f(x):
"""Function f's docstring."""
return x**2
f.a = 1
"""Function attribute f.a's docstring."""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment