Does python have the static function member like C++

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Apr 11 01:36:07 EDT 2007


> Many thanks for you!
> I've never heard of the "staticmethod" , that's great!

Note that you don't need an empty __init__ :

class AAA:
    counter = 0

    @staticmethod
    def counter_increase():
        AAA.counter += 1
        print "couter now:", AAA.counter

AAA.counter_increase()

Bye,
bearophile




More information about the Python-list mailing list