way to define static method

Eric CHAO lionchao at gmail.com
Wed Aug 22 21:34:21 CEST 2007

I think Python uses a very strange way to define static method in a
class. Why not make it like this?

class MyClass:
    def my_static_method(self):
        # self should be None as it's a static method
        # just ignore self

I'm a newcomer so maybe it's quite naive. But I just wonder why it is
designed like this.


More information about the Python-list mailing list