为什么PyCharm将嵌套代码块末尾的换行注释折叠到上一个块中?在
示例(尝试折叠第一个“if”块):def print_me(a):
# newline comment
if a == 'me':
dummy_padding = ''
if not dummy_padding:
favorite_place = 'zoo'
print(a)
else:
pass
# invisible newline comment
elif a == 'you':
dummy_padding = ''
pass
# visible newline comment
elif a == 'us':
dummy_padding = ''
if not dummy_padding:
favorite_place = 'movies'
print(favorite_place)
# visible indented comment
elif a == 'them':
dummy_padding = ''
pass
return a
Python中是否有一个规范规定函数内部的注释应该总是缩进的?如果没有,有没有什么方法可以调整PyCharm中的设置,以便在折叠嵌套代码时不会消失换行注释?在