PyCharm template for python class __init__ function

前端 未结 3 548
忘掉有多难
忘掉有多难 2020-12-16 05:16

I have a python class with several init variables:

class Foo(object):
    def __init__(self, d1, d2):
        self.d1 = d1
        self.d2 = d2
3条回答
  •  孤街浪徒
    2020-12-16 06:02

    I learned of another way to solve this.

    • Move cursor to argument
    • Press alt + enter
    • Select Add field '[arg]' to class for single arg -or-
    • Press right arrow key to open sub menu
    • Select Fix all 'unused local' problems to add all args

提交回复
热议问题