Differences between revisions 9 and 10
Revision 9 as of 2007-08-20 14:28:02
Size: 2370
Editor: XiaoQi
Comment:
Revision 10 as of 2007-08-22 10:42:37
Size: 2139
Editor: XiaoQi
Comment:
Deletions are marked like this. Additions are marked like this.
Line 39: Line 39:
 1. `stage 1` 里面的`1e` 明显是后来加上去的,`stage 2, 3, 4` 里面采用的验证输入的方案都是 `1c` 的方案(使用 `re`)而不是最佳结果 `1e` 里面的(使用 `isalpha` 方法),与实际程序不符。正在修正。 [[Include(/soundexbug)]]

Include(../xbar) 以下是 Dip 原版的勘误。勘误表中指出的错误在 svn 版中均已修正。

5. 对象和面向对象

5.2 使用 from module import 导入模块

  1. Para 2:注意粗体部分。代码中显示的被导入的对象是 UserDict,而不是 types 模块的属性和方法

Here is the basic from module import syntax:

from UserDict import UserDict

This is similar to the import module syntax that you know and love, but with an important difference: the attributes and methods of the imported module types are imported directly into the local namespace, so they are available directly, without qualification by module name.

下面是 from module import 的基本语法:

from UserDict import UserDict

它与你所熟知的 import module 语法很相似,但是有一个重要的区别:被导入模块 types 的属性和方法被直接导入到局部名字空间去了,……

  • (./) UserDict 被直接导入到局部名字空间去了

12. SOAP Web 服务

12.6 以 WSDL 进行 SOAP 内省

  1. 例 12.8:注意第二行多了一个右括号。

>>> from SOAPpy import WSDL
>>> wsdlFile = 'http://www.xmethods.net/sd/2001/TemperatureService.wsdl')
>>> server = WSDL.Proxy(wsdlFile)
>>> server.methods.keys()
[u'getTemp']

16. 函数编程

16.3 重识列表过滤

  1. 例16.7, (1)odd uses the built-in mod function "%" to return True if n is odd and False if n is even.BR odd 使用内建的取模(mod)函数 "%" 对于为奇数的 n 返回 True;为偶数的返回 FalseBR (./) odd 使用内建的取模(mod)函数 "%" 对于为奇数的 n 返回 1;为偶数的返回 0。BR (!) 1 和 0 被 typo 为 True 和 False 是有原因的,你可以在修订历史里面找到。Mark 在 Dip 的早期版本中(那时 Python 还没有独立的 bool 类型)把 True, False 与 1, 0 都混用了,后来可能是用了盲目替换,自己都被弄懵了。

18. 性能优化

Include(/soundexbug)

DiveIntoPythonZh/xe (last edited 2009-12-25 07:17:15 by localhost)