string

This module contains utility functions for string manipulation.

Summary

Functions:

is_comment_line

Returns whether the line is a comment line.

Reference

is_comment_line(
line: str,
comment_token='#',
empty_line=False,
) bool[source]

Returns whether the line is a comment line.

Parameters:
  • line (str) – The line to be checked.

  • comment_token (str, optional) – The token that indicates a comment line, by default “#”.

  • empty_line (bool, optional) – Whether an empty line should be considered a comment line, by default False.

Returns:

Whether the line is a comment line.

Return type:

bool