Correct typo and inconsistency detected by Hernan M. Foffani.
This commit is contained in:
parent
ca9c7dbdda
commit
220e3da93f
|
@ -388,8 +388,8 @@ Static methods and class methods
|
|||
|
||||
class C:
|
||||
|
||||
def foo(x, y):
|
||||
print "classmethod", x, y
|
||||
def foo(cls, y):
|
||||
print "classmethod", cls, y
|
||||
foo = classmethod(foo)
|
||||
|
||||
C.foo(1)
|
||||
|
@ -417,9 +417,10 @@ Static methods and class methods
|
|||
But notice this:
|
||||
|
||||
class E(C):
|
||||
def foo(x, y): # override C.foo
|
||||
def foo(cls, y): # override C.foo
|
||||
print "E.foo() called"
|
||||
C.foo(y)
|
||||
foo = classmethod(foo)
|
||||
|
||||
E.foo(1)
|
||||
e = E()
|
||||
|
|
Loading…
Reference in New Issue