Wikipedia词条翻译:Python

今天开始尝试翻译,也没找到什么好的材料,就选择了 Wikipedia的Python词条(反正也准备学习Python)。翻译了几小段就体会到了翻译的艰难,首先,对于Python我不太熟悉,很多相关特性,专有名词不知道怎么翻译;另外,结构复杂的句子,翻译时,困难在于重新调整语序,或者断句,从而使句子通顺,句意清楚。以下是我翻译的一点东西,实在惭愧!纯粹作为学习的记录吧...

-------------------------------------------------------------------------------------------------------------

Python(程序设计语言)


Python是一门通用的高级程序设计语言,其设计的哲学理念是强调代码的可读性。Python旨在将卓越的能力与清晰的语法结合起来,并且其具有强大而全面的的标准库。Python使用缩进作为代码块的分隔符,这在流行的程序设计语言中是少见的。

Python支持泛型编程,主要是面向对象,命令式的,但不局限于此。次要程度上是函数式编程风格。Python的主要特点是完全的动态类型系统以及自动内存管理,类似于Scheme,Ruby,Perl和Tcl.与其他动态语言一样,Python常用作脚本语言,但也大量应用于非脚本环境。

Python的参考实现(CPython)是自由开放源码软件,拥有基于社区的开发模式,其他可选择的实现也是如此。CPython由非营利Python软件基金会管理。

目录

1.历史
2.程序设计的哲学
  2.1新词汇
3.用法
4.语法与语义
  4.1缩进
  4.2声明和控制流
  4.3方法
  4.4类型
5.实现
  5.1CPython
  5.2可选择的实现
  5.3注释
6.开发
7.标准库
8.对其他语言的影响
9.相关阅读
10.参考条目

 

历史(主要内容:Python的历史)
二十世纪八十年代后期,当时工作于荷兰国家数学与计算机科学研究中心的Guido van Rossum设计了Python,并于1989年12月开始实现,目的是为了代替ABC程序设计语言(源自SETL语言),ABC语言能够处理异常以及与Amoeba操作系统进行互操作。Van Rossum是Python的主要创造者。Python社区赋予他的称号---仁慈的生命独裁者---反映了他一直以来决定Python发展方向的中心角色。

 

Python2.0发布于2000年10月16日,具有许多主要的新特性,包括:一个完整的垃圾收集器,支持Unicode编码。然而,最重要的变化是开发流程更加透明,并以社区为依托。Python3.0,一个主要的向后不兼容的版本,经过长期测试,发布于2008年12月3日。此版本的主要特性许多已反向移植到(backported)向后兼容的python2.6版本。

 

程序设计的哲学
Python是一种泛型程序设计语言。与强迫程序员适应一种特殊的程序设计风格相反,它允许若干种风格:全面支持面向对象编程和结构化编程,并且许多语言特性支持函数式编程以及面向方面编程(包含于元程序设计和魔术方法)。许多其他的范式则通过扩展来支持,比如:pyDBC和Python的一些合同(?Contracts),即允许通过合同进行设计。

 

Python使用动态类型,引用计数以及用于内存管理的循环探测(cycle-detecting)垃圾收集器。Python的一个重要特性是动态名字分解(name resolution)(后期绑定?),即在程序执行时进行方法与变量名字的绑定。

 

与将所有需要的功能植入语言核心相反,Python被设计成高度可扩展。新植入的模块可以用C,C++或CPython简单地就写成。Python也可用作已存在模块和应用程序的扩展语言,当然这些模块和应用程序需要有一个可编程接口。从一开始,Van Rossum就计划将Python设计成一种小核心的语言,同时具有强大的标准库以及扩展容易的解释器,因为ABC语言(遵循相反的设计思路)让他非常沮丧。

 

Python的设计对Lisp传统的函数式编程仅提供有限的支持。然而,Python的设计理念体现了与极简Lisp系(类Lisp?)语言(例如:Scheme)的显著相似性。标准库中有两个模块(itertools和functools)实现了从Haskell和标准ML借鉴来的已验证的函数工具。


-----------------------------------------以下是原文----------------------------------------------------

Python (programming language)

Python is a general-purpose high-level programming language [2] whose design philosophy emphasizes code readability.[3] Python aims to combine "remarkable power with very clear syntax",[4] and its standard library is large and comprehensive. Its use of indentation for block delimiters is unusual among popular programming languages.

Python supports multiple programming paradigms , primarily but not limited to object oriented , imperative and, to a lesser extent, functional programming styles. It features a fully dynamic type system and automatic memory management , similar to that of Scheme , Ruby , Perl , and Tcl . Like other dynamic languages , Python is often used as a scripting language , but is also used in a wide range of non-scripting contexts.

The reference implementation of Python (CPython ) is free and open source software and has a community-based development model, as do all or nearly all of its alternative implementations. CPython is managed by the non-profit Python Software Foundation .

Contents

[hide ]

History

Python was conceived in the late 1980s[5] and its implementation was started in December 1989[6] by Guido van Rossum at CWI in the Netherlands as a successor to the ABC programming language (itself inspired by SETL )[7] capable of exception handling and interfacing with the Amoeba operating system .[8] Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, Benevolent Dictator for Life (BDFL) .

Python 2.0 was released on 16 October 2000, with many major new features including a full garbage collector and support for Unicode . However, the most important change was to the development process itself, with a shift to a more transparent and community-backed process.[9] Python 3.0, a major, backwards-incompatible release, was released on 3 December 2008[10] after a long period of testing. Many of its major features have been backported to the backwards-compatible Python 2.6.[11]

Programming philosophy

Python is a multi-paradigm programming language . Rather than forcing programmers to adopt a particular style of programming, it permits several styles: object-oriented programming and structured programming are fully supported, and there are a number of language features which support functional programming and aspect-oriented programming (including by metaprogramming [12] and by magic methods ).[13] Many other paradigms are supported using extensions, such as pyDBC[14] and Contracts for Python[15] which allow Design by Contract .

Python uses dynamic typing and a combination of reference counting and a cycle-detecting garbage collector for memory management . An important feature of Python is dynamic name resolution (late binding ), which binds method and variable names during program execution.

Rather than requiring all desired functionality to be built into the language's core, Python was designed to be highly extensible. New built-in modules can be easily written in C , C++ or Cython . Python can also be used as an extension language for existing modules and applications that need a programmable interface. This design of a small core language with a large standard library and an easily extensible interpreter was intended by Van Rossum from the very start because of his frustrations with ABC (which espoused the opposite mindset).[5]

The design of Python offers only limited support for functional programming in the Lisp tradition. However, Python's design philosophy exhibits significant similarities to those of minimalist Lisp-family languages, such as Scheme [citation needed ] . The library has two modules (itertools and functools) that implement proven functional tools borrowed from Haskell and Standard ML .[16]

...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值