classobject.c:instancemethod_descr_get(): when a bound method is

assigned to a class variable and then accessed via an instance, it
should not be rebound.

test_descr.py:methods(): test for the condition above.
This commit is contained in:
Guido van Rossum 2001-08-16 20:41:56 +00:00
parent 2907fe6ce7
commit 501c7c7d0e
2 changed files with 6 additions and 1 deletions

View file

@ -862,7 +862,7 @@ def methods():
d2 = D(2)
verify(d2.foo() == 2)
verify(d2.boo() == 2)
verify(d2.goo() == 2)
verify(d2.goo() == 1)
def specials():
# Test operators like __hash__ for which a built-in default exists