This transformation deletes all comments in the code.
Find all comments and delete them. The supported comments type:
-
Single line comment (starts with the hash character
#
) -
Multi lines comment with using
'''...'''
-
Multi lines comment with using
"""..."""
Single line comment example
Code before transformation:
# One line comment
def foo():
# One line comment
pass
Code after transformation:
def foo():
pass
Multi lines comment with using `'''...'''` example
Code before transformation:
'''
This is a comment
written in
more than just one line
'''
def foo():
'''
This is a comment
written in
more than just one line
'''
pass
Code after transformation:
def foo():
pass
Multi lines comment with using `"""..."""` example
Code before transformation:
"""
This is a comment
written in
more than just one line
"""
def foo():
"""
This is a comment
written in
more than just one line
"""
pass
Code after transformation:
def foo():
pass