Pycharm里面的TODO功能有什么作用
1个回答
展开全部
明智的做法是:
在bug旁边写一个“#todo: computer will explode while running the program for 24+ hours”,然后继续写代码。
为了防止你今后忘掉这个bug,pycharm会在3个地方提示你:
<img src="https://pic1.zhimg.com/de3b59e9b056e6b2b441507bc7bff4ac_b.png" data-rawwidth="968" data-rawheight="553" class="origin_image zh-lightbox-thumb" width="968" data-original="https://pic1.zhimg.com/de3b59e9b056e6b2b441507bc7bff4ac_r.png">
另外,在多人协作的项目中,todo还可以用来区分“谁要去修复这个bug”。PyCharm官方文档介绍如下:
create several filters, which you will use to show the TODO items, say, for each of the developers, and not for your good self. For this purpose, in the Filters section, click , and specify the filter names, for example, For John, For Bob, and not for me. Associate these filters with the patterns:
<img src="https://pic3.zhimg.com/cece7b8eea2ba4335de15f40fbed118e_b.png" data-rawwidth="503" data-rawheight="309" class="origin_image zh-lightbox-thumb" width="503" data-original="https://pic3.zhimg.com/cece7b8eea2ba4335de15f40fbed118e_r.png">
Now, in the source code, create TODO items: in the line of code, where you want to add a note, press Ctrl+Slash, or Ctrl+Shift+Slash, and type TODO that matches one of the patterns, followed by some meaningful description:
<img src="https://pic3.zhimg.com/8a6ed87701d7a2df5791d60bfd071006_b.png" data-rawwidth="297" data-rawheight="269" class="content_image" width="297">
在bug旁边写一个“#todo: computer will explode while running the program for 24+ hours”,然后继续写代码。
为了防止你今后忘掉这个bug,pycharm会在3个地方提示你:
<img src="https://pic1.zhimg.com/de3b59e9b056e6b2b441507bc7bff4ac_b.png" data-rawwidth="968" data-rawheight="553" class="origin_image zh-lightbox-thumb" width="968" data-original="https://pic1.zhimg.com/de3b59e9b056e6b2b441507bc7bff4ac_r.png">
另外,在多人协作的项目中,todo还可以用来区分“谁要去修复这个bug”。PyCharm官方文档介绍如下:
create several filters, which you will use to show the TODO items, say, for each of the developers, and not for your good self. For this purpose, in the Filters section, click , and specify the filter names, for example, For John, For Bob, and not for me. Associate these filters with the patterns:
<img src="https://pic3.zhimg.com/cece7b8eea2ba4335de15f40fbed118e_b.png" data-rawwidth="503" data-rawheight="309" class="origin_image zh-lightbox-thumb" width="503" data-original="https://pic3.zhimg.com/cece7b8eea2ba4335de15f40fbed118e_r.png">
Now, in the source code, create TODO items: in the line of code, where you want to add a note, press Ctrl+Slash, or Ctrl+Shift+Slash, and type TODO that matches one of the patterns, followed by some meaningful description:
<img src="https://pic3.zhimg.com/8a6ed87701d7a2df5791d60bfd071006_b.png" data-rawwidth="297" data-rawheight="269" class="content_image" width="297">
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询