Liuw's Thinkpad

想要赢就先学会输,想要成功就先学会失败

Python @staticmethod vs @classmethod

with one comment

There are two predefined decorators in Python: @staticmethod and @classmethod.

I’m somewhat confused. For someone who has a shallow Java background, static method and class method are just the same.

See this for short.

And see Python PEP and manuals for details.

© 2010, liuw. All rights reserved.

Written by liuw

March 14th, 2010 at 12:21 am

One Response to 'Python @staticmethod vs @classmethod'

Subscribe to comments with RSS or TrackBack to 'Python @staticmethod vs @classmethod'.

  1. .

      (Quote)

    chsid92

    23 Mar 10 at 23:41

Leave a Reply

*