Skip to content

Inline Comments

Vinicius Reif Biavatti edited this page Jul 25, 2022 · 1 revision
  • Use one space after the # (number sign)
  • After expressions, use two spaces to separate the code and the comment
  • Never exceed the 79 line length
  • If the line length will be exceeded, create other inline comment below
  • To describe a function, method, or a class, use docstrings

✅ Do

values = [1, 2, 3]  # Important values

# Check some important thing
if True:
    pass

❌ Don't`

values = [1, 2, 3] #Important values
values = [1, 2, 3] # Important values (without 2 spaces)

# Main function (use docstring in this case)
def main():
    ...
Clone this wiki locally