eval



class myBook():
def __init__(self, book):
self.book = book

def readbook(self):
print(self.book, '--GOOD')


d = eval("myBook('Java Book')")

if hasattr(d, 'readbook'):
print(11)
else:
print(2)
posted @ 2017-12-05 15:23  papering  阅读(155)  评论(0编辑  收藏  举报