mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
classic(),metods(): add tests to verify that a bound method without a
class has a correct repr().
This commit is contained in:
parent
f23c41d56a
commit
84a79a8d25
1 changed files with 2 additions and 0 deletions
|
@ -763,6 +763,7 @@ def classic():
|
|||
class E: # *not* subclassing from C
|
||||
foo = C.foo
|
||||
verify(E().foo == C.foo) # i.e., unbound
|
||||
verify(repr(C.foo.__get__(C())).startswith("<bound method "))
|
||||
|
||||
def compattr():
|
||||
if verbose: print "Testing computed attributes..."
|
||||
|
@ -907,6 +908,7 @@ def methods():
|
|||
class E(object):
|
||||
foo = C.foo
|
||||
verify(E().foo == C.foo) # i.e., unbound
|
||||
verify(repr(C.foo.__get__(C(1))).startswith("<bound method "))
|
||||
|
||||
def specials():
|
||||
# Test operators like __hash__ for which a built-in default exists
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue