37 ''' This module contains the CommentableMixin implementation.'''
42 Mixin that adds the Commentable trait into a PSyIR node. It provides
43 two attributes that store preceding and inline comments and their
44 respective property getters and setters.
51 _preceding_comment =
""
57 :returns: comment preceding this statement.
62 @preceding_comment.setter
65 :param str comment: comment preceding this statement.
67 if not isinstance(comment, str):
68 raise TypeError(f
"The preceding_comment must be a string but"
69 f
" found '{type(comment).__name__}'.")
75 :returns: inline comment associated with this statement.
80 @inline_comment.setter
83 :param str comment: inline comment associated with this statement.
85 if not isinstance(comment, str):
86 raise TypeError(f
"The inline_comment must be a string but"
87 f
" found '{type(comment).__name__}'.")
92 __all__ = [
"CommentableMixin"]