码迷,mamicode.com
首页 > 其他好文 > 详细

面对对象的随笔

时间:2017-11-13 13:58:47      阅读:93      评论:0      收藏:0      [点我收藏+]

标签:小明   __call__   pass   init   name   sel   people   对象   self   

class people:

  def __init__(self,name,age):

    self.name=name

    self.age=age

  def__call__(self):

    pass

p1=people(‘小明‘,21)#执行init方法

p1()#执行call方法

面对对象的随笔

标签:小明   __call__   pass   init   name   sel   people   对象   self   

原文地址:http://www.cnblogs.com/wang666/p/7825556.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!