Python函数调用

#!/usr/bin/python
#coding=gb2312
class tester:
    def __init__(self,start):
        self.state=start;
#    def mested(self,label):
#        print(label,self.state);
#        self.state+=1;
    def __call__(self,label):
        print(label,self.state);
        self.state+=1;

 

转载于:https://my.oschina.net/xiaocon/blog/199343

你可能感兴趣的:(Python函数调用)