浙江省高等学校教师教育理论培训

微信搜索“毛凌志岗前心得”小程序

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

  1 #!/usr/bin/env python
  2 #encoding=utf-8
  3 class A(object):
  4   def __init__(self):
  5     print "a init"
  6     print self.__class__
  7
  8   def do(self):
  9     print self.__class__.__name__
 10 class B(A):
 11   def __init__(self):
 12     #A.__init__(self)
 13     super(B,self).__init__()
 14     print "b init"
 15
 16   def do(self):
 17     print "ok buddy"
 18     super(B,self).do()
 19
 20 b=B()
 21 b.do()

posted on 2012-11-27 16:18  lexus  阅读(370)  评论(0编辑  收藏  举报