abc()接受33个位置参数,但给出了35个位置

时间:2018-11-02 17:58:02

标签: python-3.x function class object

有一个类似下面的python 3.7文件

class FraudIncremental():

    def run(self):
          html = self.make_html_email(self.overview, start_date, end_date, url,
                                      url2, url3, url4, url6, url5, url7, url8, url9,
                                      url10, url11, url12, url15, url16, url17, url18, count_one_device,
                                      count_fulfillment, count_sum2, count_sum1,
                                      count_7, count_lonely, count_patrol, count_disputes,
                                      count_clear, count_decline, count_dfg, count_settle20, count_country, count_abc, cfg)


    def abc(self, overview, start_date, end_date, url, url2,
                        url3, url4, url6, url5, url7, url8, url9,
                        url10, url11, url12, url13, url14, url15, url16, count3, count4,
                        count5, count6, count7, count8, count9,
                        count10, count11, count12, count13, count14, count15, count16, cfg):
        rules = self.parse_df(overview, cfg)
        amounts= self.parse_df_sum(self.counts)
        counted = self.parse_df_count(self.counts)

        template_vars = {
            "startdate" : start_date,
            "enddate": end_date,
            "rules": rules,
            "url": url,
            # remove "urlN": urlN, (where N=2~15), OTHERWISE stackoverflow thinks the post contains mostly codes
            "url16": url16,
            "count3": count3,
            # remove "countN": countN, (where N=4~15), OTHERWISE stackoverflow thinks the post contains mostly codes
            "count16": count16,
            "amounts": amounts,
            "counted": counted
        }
        html_out = make_html(template_path = "xyz",
                             template_vars = template_vars)

        return html_out

运行此代码时,出现错误消息:

abc() takes 33 positional arguments but 35 were given

我真的很困惑,因为在这种情况下abc()应该接受35个参数?缺什么?谢谢!

0 个答案:

没有答案