What does the TODO function inside the pycharm do?

Source: Internet
Author: User

Reply content:

When
working on a project, it's often needed to create a list of the tasks for yourself or your team mates. While usually these tasks is described in a issue tracker like Youtrack , some tasks is either too small or t Oo code-specific to describe in an issue tracker. In such a case, adding TODO comments in source code makes sense.
Specifically, when you write code, suddenly realize that your previous code has a potential small bug, but not important, the common practice is:
    • Fix the bug right away, and then when you return to your current job, your train of thought is interrupted.
    • Put the bug in your head, keep writing your code, and soon the bug will be forgotten.
    • Make a comment in the bug, continue to write the code, and soon the bug has been forgotten by you, a long time later, when you turn to the previous code, you find there is a comment
    • ......
The sensible thing to do is:
next to the bug, write a "#todo: Computer will explode while running the program for 24+ hours"and then continue writing the code.
To prevent you from forgetting this in the future, Bug,pycharm will prompt you in 3 places:

In addition, in multi-person collaborative projects, TODO can also be used to differentiate "Who's going to fix this bug?"。 Pycharm Official documents Introduced as follows:
create several filters, which you'll use to show the TODO items, say, for each of the developers, and not for your Good self. For this purpose, the Filters section, click, and specify the filter names, for example, for John, for Bob, and not fo R me. Associate These filters with the patterns:

Now, under the source code, create TODO items:in the line of code, where you want to add a note, press Ctrl+slash, or Ctrl+s Hift+slash, and type TODO that matches one of the patterns, followed by some meaningful description:
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.