Size: 3123
Comment:
|
← Revision 27 as of 2009-12-25 07:14:28 ⇥
Size: 3154
Comment: converted to 1.6 markup
|
Deletions are marked like this. | Additions are marked like this. |
Line 7: | Line 7: |
::-- ZoomQuiet [[[DateTime(2005-09-06T03:57:19Z)]]] [[TableOfContents]] |
::-- ZoomQuiet [<<DateTime(2005-09-06T03:57:19Z)>>] <<TableOfContents>> |
Line 14: | Line 14: |
'''[http://www.norvig.com/python-iaq.html Infrequently Answered Questions]''' -- norvig.com * by [mailto:[email protected] Peter Norvig] * [http://www.chenwy.com/python-iaq-cn.html Python IAQ:少有回答的问题]^官方中文版^ |
'''[[http://www.norvig.com/python-iaq.html|Infrequently Answered Questions]]''' -- norvig.com * by [[mailto:[email protected]|Peter Norvig]] * [[http://www.chenwy.com/python-iaq-cn.html|Python IAQ:少有回答的问题]]^官方中文版^ |
Line 22: | Line 22: |
1. [:PyIAQ/Q1: Q: What is an Infrequently Answered Question?] 1. [:PyIAQ/Q2: Q: finally子句里面代码是不是总是会被执行?] 100%-- ["huangyi"] |
1. [[PyIAQ/Q1| Q: What is an Infrequently Answered Question?]] 1. [[PyIAQ/Q2| Q: finally子句里面代码是不是总是会被执行?]] 100%-- [[huangyi]] |
Line 25: | Line 25: |
1. [:PyIAQ/Q3: Q: Polymorphism is great; I can sort a list of elements of any type, right?] 1. [:PyIAQ/Q4: Q:在python中 怎样才能写++x,x++那样?] 1. [:PyIAQ/Q5: Q: 我能使用从C++里的流控制语法吗: cout << x << y ... ?] 1. [:PyIAQ/Q6: Q: What if I like C++'s printf?] 1. [:PyIAQ/Q7: Q: 是否有一种更好的语法来编写字典文本?所有keys都是标识符。] 未完成-- ["huangyi"] |
1. [[PyIAQ/Q3| Q: Polymorphism is great; I can sort a list of elements of any type, right?]] 1. [[PyIAQ/Q4| Q:在python中 怎样才能写++x,x++那样?]] 1. [[PyIAQ/Q5| Q: 我能使用从C++里的流控制语法吗: cout << x << y ... ?]] 1. [[PyIAQ/Q6| Q: What if I like C++'s printf?]] 1. [[PyIAQ/Q7| Q: 是否有一种更好的语法来编写字典文本?所有keys都是标识符。]] 未完成-- [[huangyi]] |
Line 31: | Line 31: |
1. [:PyIAQ/Q8: Q: Is there a similar shortcut for objects?] 1. [:PyIAQ/Q9: Q: 创建对象很爽,但是如何更新?] 100%-- ZoomQuiet |
1. [[PyIAQ/Q8| Q: Is there a similar shortcut for objects?]] 1. [[PyIAQ/Q9| Q: 创建对象很爽,但是如何更新?]] 100%-- ZoomQuiet |
Line 34: | Line 34: |
1. [:PyIAQ/Q10: Q: 我能给字典设定默认值吗0,{}或者其它的值?] 1. [:PyIAQ/Q11: Q: 嘿, 你可以在0.007kb以内的代码里转置一个矩阵吗?] 95%-- ["huangyi"] |
1. [[PyIAQ/Q10| Q: 我能给字典设定默认值吗0,{}或者其它的值?]] 1. [[PyIAQ/Q11| Q: 嘿, 你可以在0.007kb以内的代码里转置一个矩阵吗?]] 95%-- [[huangyi]] |
Line 37: | Line 37: |
1. [:PyIAQ/Q12: Q: f(*m)这个技巧确实不错。不知道这个语法是否可以用在方法调用上, 比如 x.f(*y)?] todo-- ["huangyi"] | 1. [[PyIAQ/Q12| Q: f(*m)这个技巧确实不错。不知道这个语法是否可以用在方法调用上, 比如 x.f(*y)?]] todo-- [[huangyi]] |
Line 39: | Line 39: |
1. [:PyIAQ/Q13: Q: Can you implement abstract classes in Python in 0 lines of code? Or 4?] 1. [:PyIAQ/Q14: Q: How do I do Enumerated Types (enums) in Python?] 1. [:PyIAQ/Q15: Q: Why is there no ``Set'' data type in Python?] 1. [:PyIAQ/Q16: Q: 我能在python里使用布尔型数据吗?] 1. [:PyIAQ/Q17: Q: Can I do the equivalent of (test ? result : alternative) in Python?] 1. [:PyIAQ/Q18: Q: What other major types are missing from Python?] 1. [:PyIAQ/Q19: Q: How do I do the Singleton Pattern in Python?] 1. [:PyIAQ/Q20: Q: Is no "news" good news?] 1. [:PyIAQ/Q21: Q: Can I have a history mechanism like in the shell?] 1. [:PyIAQ/Q22: Q: How do I time the execution of my functions?] 1. [:PyIAQ/Q23: Q: python的自启动文件是什么样子的?] 1. [:PyIAQ/Q24: Q: 我该怎样往 类里传递参数?] 1. [:PyIAQ/Q25: Q: 当我试图调用类里的方法时,出现错误了?] |
1. [[PyIAQ/Q13| Q: Can you implement abstract classes in Python in 0 lines of code? Or 4?]] 1. [[PyIAQ/Q14| Q: How do I do Enumerated Types (enums) in Python?]] 1. [[PyIAQ/Q15| Q: Why is there no ``Set'' data type in Python?]] 1. [[PyIAQ/Q16| Q: 我能在python里使用布尔型数据吗?]] 1. [[PyIAQ/Q17| Q: Can I do the equivalent of (test ? result : alternative) in Python?]] 1. [[PyIAQ/Q18| Q: What other major types are missing from Python?]] 1. [[PyIAQ/Q19| Q: How do I do the Singleton Pattern in Python?]] 1. [[PyIAQ/Q20| Q: Is no "news" good news?]] 1. [[PyIAQ/Q21| Q: Can I have a history mechanism like in the shell?]] 1. [[PyIAQ/Q22| Q: How do I time the execution of my functions?]] 1. [[PyIAQ/Q23| Q: python的自启动文件是什么样子的?]] 1. [[PyIAQ/Q24| Q: 我该怎样往 类里传递参数?]] 1. [[PyIAQ/Q25| Q: 当我试图调用类里的方法时,出现错误了?]] |
Line 56: | Line 56: |
["Py技术文档分类"] | [[Py技术文档分类]] |
Python 罕见问题集 ::-- ZoomQuiet [2005-09-06 03:57:19]
Contents
include(PyHiddenFeatures,,from="^##startInc$",to="^##endInc$")
1. Python 罕见问题集
1.1. 起源
Infrequently Answered Questions -- norvig.com
by Peter Norvig
Python IAQ:少有回答的问题官方中文版
- 收集Python 极精细的特性问题!值得学习!
大家来共同翻译吧!创建页面时使用 PyIAQ模板 是也乎…………
1.2. 中译
Q: finally子句里面代码是不是总是会被执行? 100%-- huangyi
- The code in a finally clause will never fail to execute, right?
Q: Polymorphism is great; I can sort a list of elements of any type, right?
Q: 是否有一种更好的语法来编写字典文本?所有keys都是标识符。 未完成-- huangyi
- Is there a better syntax for dictionary literals? All my keys are identifiers
Q: 创建对象很爽,但是如何更新? 100%-- ZoomQuiet
- That's great for creating objects; How about for updating?
Q: 嘿, 你可以在0.007kb以内的代码里转置一个矩阵吗? 95%-- huangyi
- Hey, can you write code to transpose a matrix in 0.007KB or less?
Q: f(*m)这个技巧确实不错。不知道这个语法是否可以用在方法调用上, 比如 x.f(*y)? todo-- huangyi
- The f(*m) trick is cool. Does the same syntax work with method calls, like x.f(*y)?
Q: Can you implement abstract classes in Python in 0 lines of code? Or 4?
Q: Can I do the equivalent of (test ? result : alternative) in Python?