Differences between revisions 3 and 13 (spanning 10 versions)
Revision 3 as of 2007-01-14 10:36:23
Size: 1911
Editor: swordsp
Comment:
Revision 13 as of 2007-01-14 16:11:22
Size: 6258
Editor: swordsp
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
##language:zh
''' Python 语言研究 '''::-- ["swordsp"] [[[DateTime]]] [[TableOfContents]]

[[Include(swordsp/COTW/Header)]]
Line 3: Line 8:
对于一种编程语言来说,语法格式是其最直观的表现,各种类库的 API 是其最直接的应用。
但在水面之下,语言的基础设施、模型、原理以及背后的设计哲学才是其最本质的部分,也是一种语言真正区别于另一种的所在。
此条目关注 Python 本身语言、语法的研究和探讨,收集整理相关的文档和心得(尤其是中文资料),一般不涉及具体的类库使用。
如无特别注明,均以 CPython 实现为准。
Line 4: Line 14:

 * 参见[:PyBooks:Python 图书概览]
 . 对于语言特性的学习来说,特别推荐以下几本
  * 《Python Tutorial》(最新版本2.5) -- 最新,最权威,公开文档
  * 《A Byte of Python》 -- 简洁明了,浅显易懂,公开文档
  * 《Learning Python》(第二版) -- 最细致,最深入
  * 《Text Process in Python》的附录A :[:TPiP/AppendixA:python精要]
  . “对 python 的超精简的但绝不失深度的介绍” -- from 译者 HuangYi

== 语言进化 ==

 * [http://docs.python.org/dev/whatsnew/whatsnew25.html What's New in Python 2.5]
  * [http://www.aleax.it/Python/py25.pdf Python 2.5 Slides by Alex Martelli]
  * [:WeiZhong/WhatsNewOfPython25:WeiZhong 节译]
  * [:PythoNology/New4Py2.5:ZoomQuiet 译自另一篇文档]

 * [http://docs.python.org/dev/whatsnew/ What's New in Python 2.6]

 * [:Python3000:Python 3000 专题] -- 收集了 Python 3000 的规范、展望和最新消息
Line 9: Line 38:
 * [http://www.voidspace.org.uk/python/articles/python_datatypes.shtml A Very Brief Introduction to Python And its Data-Types]
 . “一篇短小精悍的 python tutorial 。对一些容易被忽视的问题讲得很清楚!很专业的 tutorial!” -- from HuangYi
Line 11: Line 43:
==== 自省 ====
 * [http://www.ibm.com/developerworks/cn/linux/l-pyint/index1.html Python 自省指南]、[http://www.ibm.com/developerworks/cn/linux/l-pyint/index2.html (二)] (原网页上“下一页”链接有误)
 . 发表于 IBM developerWorks 网站,作者 Patrick O'Brien 是 PyCrust 的作者,此为中文版。

 * [:PyBatteriesIncluded:内省的威力]

==== Iterator 和 Generator ====
 * [http://blog.donews.com/limodou/archive/2004/07/10/40913.aspx Iterator 和 Generator的学习心得] by limodou
==== Decorator ====
Line 13: Line 54:
  * [http://blog.donews.com/limodou/archive/2004/12/19/207521.aspx decorator的使用] by limodou
  * [http://www.donews.net/limodou/archive/2004/12/20/208356.aspx Decorator 应用:使用decorator的线程同步] by limodou
  * [http://blog.donews.com/limodou/archive/2004/12/31/221653.aspx 关于阅读《Doing abstract methods with decorators》的思考] by limodou
Line 14: Line 58:
 * [:Py25yieldNote:Py2.5 yield 详说] -- shhgs 和 limodou 关于 yield 在2.5中语法加强的探讨 ==== yield ====
* [:Py25yieldNote:Py2.5 yield 详说] -- shhgs 和 limodou 关于 yield 在2.5中加强语法的探讨

==== with ====
Line 18: Line 65:
 * [http://www.cafepy.com/article/python_types_and_objects Python Types and Objects] ==== 概述 ====
 * Python 官方网站上的 [http://www.python.org/doc/newstyle/ New-style Classes 经典文档汇集]
Line 20: Line 68:
 * [http://www.cafepy.com/article/python_attributes_and_methods/ Python Attributes and Methods]  * 两篇系统讲解的精彩文档
  * [http://www.cafepy.com/article/python_types_and_objects Python Types and Objects]
 
* [http://www.cafepy.com/article/python_attributes_and_methods/ Python Attributes and Methods]
Line 22: Line 72:
 . 两篇精彩的文档,讲解很透彻  * [:PyNewStyleClass:Python 中的新型类及其实例详解] -- WeiZhong 节译自《Python in a Nutshell》(第一版)
Line 24: Line 74:
 * [:PyNewStyleClass:Python中的新型类及其实例详解] -- WeiZhong 节译自《Python in a Nutshell》(第一版) ==== Metaclass ====
Line 28: Line 78:
 * [http://www.ibm.com/developerworks/cn/linux/l-pymeta/index.html Python 中的元类编程]、[http://www.ibm.com/developerworks/cn/linux/l-pymeta2/index.html Python 中的元类编程,第 2 部分]
 . 发表于 IBM developerWorks 网站,作者为知名 Python 专栏作家 David Mertz,此为中文版。

 * [http://www.python.org/pycon/dc2004/papers/24/metaclasses-pycon.pdf Python Metaclasses: Who? Why? When?] -- 2004年 Py{{{}}}Con 上的一篇讲稿
Line 29: Line 84:
 . Python 在成员方法中对 self 的显式声明往往会令初学者困惑和不习惯,Michael Foord在这篇文章中利用 metaclass 和 bytecode 实现了一种不需要显式声明 self 参数的类定义方式。  . Python 在成员方法中对 self 的显式声明往往会令初学者困惑和不习惯,Michael Foord 在这篇文章中利用 metaclass 和 bytecode 实现了一种不需要显式声明 self 参数的类定义方式。
Line 31: Line 86:
 * [http://codeplayer.blogspot.com/2006/12/python-method-function-descriptor.html 理解 python 的 method 和 function 兼谈 descriptor] by HuangYi  * HuangYi 的心得,发表于[http://codeplayer.blogspot.com 他的 blog]
  * [http://codeplayer.blogspot.com/2006/12/metaclass-in-python.html metaclass in python (part 1)]
  * [http://codeplayer.blogspot.com/2006/12/metaclass-in-python-part-2.html metaclass in python (part 2)]
Line 33: Line 90:
==== Descriptor ====
Line 34: Line 92:

  * [http://codeplayer.blogspot.com/2006/12/python-method-function-descriptor.html 理解 python 的 method 和 function 兼谈 descriptor] by HuangYi

==== Magic Methods ====
 * [http://blog.donews.com/limodou/archive/2004/10/16/134808.aspx 使用__getattr__要注意的]、[http://blog.donews.com/limodou/archive/2004/10/18/137326.aspx 又一次谈“使用__getattr__要注意的”]
 . 自定义 __getattr__ 带来的意想不到的副作用, from [http://blog.donews.com/limodou/ limodou 的学习记录]
Line 37: Line 101:
=== 语言进化 ===

 * [http://docs.python.org/dev/whatsnew/whatsnew25.html What's New in Python 2.5]
  * [:WeiZhong/WhatsNewOfPython25:WeiZhong 节译]
  * [:New4Py2.5:ZoomQuiet 译自另一篇文档]
Line 45: Line 103:
 * [http://www.donews.net/limodou/archive/2004/12/28/218443.aspx Python 中的 Lazy 计算]

== 参考 ==
 * http://www.python.org/doc/newstyle/
 * ["ThinkIntoPython"]
 * ["PythonZhDoc"]
 * ["PythoNology"]
 * [http://blog.donews.com/limodou/ limodou 的学习记录] -- limodou 的 blog
 * [http://codeplayer.blogspot.com 白菜] -- HuangYi 的 blog
 * http://www.voidspace.org.uk/python/index.shtml

Python 语言研究 ::-- ["swordsp"] [DateTime] TableOfContents

Include(swordsp/COTW/Header)

概述

对于一种编程语言来说,语法格式是其最直观的表现,各种类库的 API 是其最直接的应用。 但在水面之下,语言的基础设施、模型、原理以及背后的设计哲学才是其最本质的部分,也是一种语言真正区别于另一种的所在。 此条目关注 Python 本身语言、语法的研究和探讨,收集整理相关的文档和心得(尤其是中文资料),一般不涉及具体的类库使用。 如无特别注明,均以 CPython 实现为准。

系统学习

  • 参见[:PyBooks:Python 图书概览]

  • 对于语言特性的学习来说,特别推荐以下几本
    • 《Python Tutorial》(最新版本2.5) -- 最新,最权威,公开文档
    • 《A Byte of Python》 -- 简洁明了,浅显易懂,公开文档
    • 《Learning Python》(第二版) -- 最细致,最深入
    • 《Text Process in Python》的附录A :[:TPiP/AppendixA:python精要]

    • “对 python 的超精简的但绝不失深度的介绍” -- from 译者 HuangYi

语言进化

专题剖析

内置类型和操作符

语句和语法

自省

Iterator 和 Generator

Decorator

yield

  • [:Py25yieldNote:Py2.5 yield 详说] -- shhgs 和 limodou 关于 yield 在2.5中加强语法的探讨

with

名字空间与对象模型

概述

Metaclass

Descriptor

Magic Methods

异常机制

其它

参考

PythonLanguage (last edited 2009-12-25 07:15:24 by localhost)