[static methods, class methods]
Both of these are rarely used; I don't think I have ever written a
class method in live code. I have used staticmethods as a convenient
way to put a function into a class namespace.
this is someone out of the flow of the current thread now, but i
forgot to
On Thu, Jun 12, 2008 at 7:48 PM, Alan Gauld [EMAIL PROTECTED] wrote:
Kent Johnson [EMAIL PROTECTED] wrote
I am still unsure of the difference of static and class methods.
No, that wasn't me, it was Christopher Spears.
You are not alone, it is confusing!
A class method receives the class
Kent Johnson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, Jun 12, 2008 at 7:48 PM, Alan Gauld
[EMAIL PROTECTED] wrote:
Kent Johnson [EMAIL PROTECTED] wrote
I am still unsure of the difference of static and class methods.
No, that wasn't me, it was Christopher Spears.
On Wed, Jun 11, 2008 at 12:17 AM, Christopher Spears
[EMAIL PROTECTED] wrote:
tcm.foo
bound method classobj.foo of class __main__.TestClassMethod at 0xb7da0f2c
According to the author, the result for typing in 'tcm.foo' is
calling class method foo()
foo() is part of class: TestClassMethod
I am reading Wesley Chun's Core Python Programming (2nd Edition) and have
reached the part on static and class methods. I typed in the following to
demonstrate the difference between the two methods:
class TestClassMethod:
... def foo(cls):
... print 'calling class method foo()'
On Tue, June 10, 2008 9:17 pm, Christopher Spears wrote:
I am reading Wesley Chun's Core Python Programming (2nd Edition) and
have reached the part on static and class methods. I typed in the
following to demonstrate the difference between the two methods:
class TestClassMethod:
...