def concatenate_adjacent_comments(self):

        def concatenate(region1, region2):
            return region1.cover(region2)

        def is_adjacent(region1, region2):
            region_inbetween = Region(region1.end(), region2.begin())
            return len(self.view.substr(region_inbetween).strip()) == 0

        concatenated_comments = []

        for prev_comment, comment in previous_and_current(self.comments):
            concatenated_comment = None

            # prev wont be set on first iteration
            if prev_comment and is_adjacent(prev_comment, comment):
                concatenated_comment = concatenate(concatenated_comments.pop(), comment)

            concatenated_comments.append(concatenated_comment or comment)

        self.comments = concatenated_comments
Detect dictionary set events and emit change events.
dataset/ETHPy150Open oskarols/foldcomments/foldcomments.py/CommentNodes.concatenate_adjacent_comments--crossover with--dataset/ETHPy150Open openstack/sahara/sahara/db/sqlalchemy/types.py/MutableDict.__setitem__