我有一个类和一个子类,并且想从框架prefect.io继承一个带有装饰器@task的方法。
\n代码示例:
\n班级
\n@task\ndef test1(self):\n pass\nRun Code Online (Sandbox Code Playgroud)\n子类
\ndef test2(self):\n print("succeed")\nRun Code Online (Sandbox Code Playgroud)\n但现在方法test2不再具有装饰器@task了。我可以\xc2\xb4t在子类中声明@task 。我是否可以覆盖该方法但保留@task?
\n