add by zhj:今天在学习SimpleHTTPServer的源代码时,看到了Python标准库SocketServer模块中有个BaseServer类,该类的__init__方法定义如下 def __init__(self, server_address, RequestHandlerClass): """Constructor. May be extended, do not override.""" self.server_addres…
在Python编程中经常会遇到函数(function),方法(method)及属性(attribute)以下划线'_'作为前缀,这里做个总结. 主要存在四种情形: 1. object # public 2. __object__ # special, python system use, user should not define like it 3. __object # private (name mangling during runtime) 4. _object # obey pyt…
看mentor的脚本时,遇到self._item.callspec.getparam('')语句,理解起来比较困难,找到一篇文章,记录的比较详细,特别记录一下,以备复习. 附链接地址:http://www.chengxuyuans.com/Python/67370.html 顺带粘一下正文,方便大家学习: 主要存在四种情形 1. object # public 2. __object__ # special, python system use, user should not de…