mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
28 lines
419 B
Python
28 lines
419 B
Python
|
|
class Test1:
|
|
def test(self):
|
|
return 'test 1'
|
|
|
|
|
|
class Test2:
|
|
def test(self):
|
|
return 'test 2'
|
|
|
|
t1 = Test1()
|
|
tt1 = type(t1)
|
|
ttt1 = tt1()
|
|
|
|
t2 = Test2()
|
|
tt2 = type(t2)
|
|
ttt2 = tt2()
|
|
|
|
assert ttt1.test() == 'test 1'
|
|
assert ttt2.test() == 'test 2'
|
|
assert type(ttt1) == Test1
|
|
assert type(ttt2) == Test2
|
|
assert type(ttt1) != type(ttt2)
|
|
assert type(ttt1) != Test2
|
|
assert type(ttt2) != Test1
|
|
|
|
print('PASS')
|