You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
286 B
18 lines
286 B
11 years ago
|
class A:
|
||
|
def __bool__(self):
|
||
|
print('__bool__')
|
||
|
return True
|
||
|
def __len__(self):
|
||
|
print('__len__')
|
||
|
return 1
|
||
|
|
||
|
class B:
|
||
|
def __len__(self):
|
||
|
print('__len__')
|
||
|
return 0
|
||
|
|
||
|
print(bool(A()))
|
||
|
print(len(A()))
|
||
|
print(bool(B()))
|
||
|
print(len(B()))
|