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:
|
class C:
|
||||||
|
|
||||||
def foo(x, y):
|
def foo(cls, y):
|
||||||
print "classmethod", x, y
|
print "classmethod", cls, y
|
||||||
foo = classmethod(foo)
|
foo = classmethod(foo)
|
||||||
|
|
||||||
C.foo(1)
|
C.foo(1)
|
||||||
|
@ -417,9 +417,10 @@ Static methods and class methods
|
||||||
But notice this:
|
But notice this:
|
||||||
|
|
||||||
class E(C):
|
class E(C):
|
||||||
def foo(x, y): # override C.foo
|
def foo(cls, y): # override C.foo
|
||||||
print "E.foo() called"
|
print "E.foo() called"
|
||||||
C.foo(y)
|
C.foo(y)
|
||||||
|
foo = classmethod(foo)
|
||||||
|
|
||||||
E.foo(1)
|
E.foo(1)
|
||||||
e = E()
|
e = E()
|
||||||
|
|
Loading…
Reference in New Issue