Live Templates

    Create new πŸ”—

    Source: https://www.jetbrains.com/help/pycharm/creating-and-editing-live-templates.html

    TLDR πŸ”—

    • Go to Settings -> Editor -> Live Templates
    • Copy a similar one and paste it (ensure to define contexts in which it can be used)

    Details πŸ”—

    For details see instructions from source.