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.
17 lines
235 B
17 lines
235 B
# test builtin issubclass
|
|
|
|
class A:
|
|
pass
|
|
|
|
print(issubclass(A, A))
|
|
print(issubclass(A, (A,)))
|
|
|
|
try:
|
|
issubclass(A, 1)
|
|
except TypeError:
|
|
print('TypeError')
|
|
|
|
try:
|
|
issubclass('a', 1)
|
|
except TypeError:
|
|
print('TypeError')
|
|
|