coolair
V2EX  ›  问与答

请教下 FlaskForm 继承类的__init__书写方式

  •  
  •   coolair · May 7, 2018 · 1315 views
    This topic created in 2933 days ago, the information mentioned may be changed or developed.

    一直以来都是这样写

    Class MyForm(FlaskForm):
        ...
    
        def __init__(self, *args, **kwargs):
            super(MyForm, self).__init__(*args, **kwargs)
    

    今天发下 PyCharm 提示: old-style class contains call for super method

    新写法应该是怎样的?

    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1403 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 17:09 · PVG 01:09 · LAX 10:09 · JFK 13:09
    ♥ Do have faith in what you're doing.