Correct typo and inconsistency detected by Hernan M. Foffani.

This commit is contained in:
Guido van Rossum 2001-07-29 23:02:52 +00:00
parent ca9c7dbdda
commit 220e3da93f
1 changed files with 4 additions and 3 deletions

View File

@ -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()