Working with TODO in PyCharm

This post originally written for PhpStorm by Maarten Balliauw, our Jetbrains Technical Evangelist, highlights simple yet handy “TODO” feature available in our Python IDE as well:

When working on a project, it’s often desirable to create a list of tasks for yourself or your team mates. While usually these tasks are described in an issue tracker like YouTrack, some tasks are either too small or too code-specific to describe in an issue tracker. In such case, adding TODO comments in source code makes sense.

Many developers already use comments in their code to describe these small tasks, typically using a statement like the following:

PyCharm recognizes these comments and will automatically display them in the TODO tool Window (Alt+6 or View | Tool Windows | TODO):

From the TODO tool window, we can select a TODO comment and navigate to it by double-clicking it or using the Jump to Source context menu (F4).

There are a lot more features in PyCharm around TODO comments. Check our tutorials page for advanced topics like todo pattern recognition, live templates and todo filtering.

As always, we appreciate your feedback in the comments below or in our forum!

Note: This functionality is available in IntelliJ Idea, PyCharm, WebStorm, PhpStorm, RubyMine, and AppCode.

Develop with pleasure!
– PyCharm Team

About Dmitry Filippov

Product Marketing Manager at JetBrains
This entry was posted in Cool Feature. Bookmark the permalink.

6 Responses to Working with TODO in PyCharm

  1. Bob Stein says:

    If you are confounded as I was by “Found 0 TODO items in 0 files” take note of the tabs immediately above that message in the TODO view window. It probably highlights the most recent commit. Click instead on the Project tab or the Current File tab to get your TODO list.

  2. Varun Vats says:

    TODO comments inside docstrings aren’t picked up though.

  3. Varun Vats says:

    I know that TODOs are generally used and recognized only inside comments, but if say you want to remind yourself to add doctests and do something like the following, they won’t be recognized:

  4. Jason Wolosonovich says:

    recognizing multi-line TODO statements would be nice as well (without having to enter TODO again). I guess they’re not *really* necessary, however, I get pretty wordy with my TODO comments so that I can return (months) later and remember exactly what I wanted to add/change. Great feature overall though! Would be nice to recognize TODO inside of block comments (I know, submit a feature request). Loving PyCharm overall though, especially coming from Canopy. Once I got it dialed in, I haven’t given Canopy a second thought.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">