Python2静态方法具有引用该类的默认参数

时间:2018-08-16 10:14:12

标签: python python-2.7

class Freshdesk_IO(object):

  FRESHDESK = u"FRESHDESK"

  @staticmethod
    def create_ticket(ticket, attached_files=list([]), first_try=True, platform=Freshdesk_IO.FRESHDESK):
      pass

使用此代码,我得到

def create_ticket(ticket, attached_files=list([]), first_try=True, platform=Freshdesk_IO.FRESHDESK):
NameError: name 'Freshdesk_IO' is not defined

我不能在静态方法中将FRESHDESK常量用作默认参数吗?

感谢您的帮助

0 个答案:

没有答案