| Python (programming Language) |
Article Index for Python |
Website Links For Python |
Information AboutPython (programming Language) |
Python is a High-level Programming Language first released by Guido Van Rossum in 1991. Python is designed around a philosophy which emphasizes readability and the importance of computer effort over programmer effort. Python core syntax and semantics are considered Minimalist , while the Standard Library is considered large and comprehensive. Community practices in Python programming have led to the recognition of a Python Philosophy . Python is a Multi-paradigm Programming Language (functional, object oriented and imperative) which has a fully Dynamic Type system and uses automatic Memory Management ; it is thus similar to Perl , Ruby , Scheme , and Tcl . The language has an open, community-based development model managed by the non-profit Python Software Foundation . While various parts of the language have formal specifications and standards, the language as a whole is not formally specified. The '' De Facto '' standard for the language is the CPython implementation. HISTORY Python was conceived in the late 1980s2 by Guido van Rossum at CWI in the Netherlands as a successor of the ABC Programming Language capable of Exception Handling and interfacing with the Amoeba Operating System . Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is acknowledged by referring to him as its ''Benevolent Dictator For Life'' (BDFL) . In 1991, van Rossum published the code (labeled version 0.9.0) to Alt.sources . Already present at this stage in development were classes with inheritance, exception handling, functions, and the core datatypes of list, dict, str and so on. Also in this initial release was a Module System borrowed from Modula-3 ; van Rossum describes the module as "one of Python's major programming units". Python's exception model also resembles Modula-3's, with the addition of an else clause. In 1994, comp.lang.python , the primary discussion forum for Python, was formed, marking a milestone in the growth of Python's userbase.Python reached version 1.0 in January 1994. A major set of features included in this release were the functional programming tools Lambda , map, filter and Reduce . Van Rossum states that "Python acquired lambda, reduce(), filter() and map(), courtesy of (I believe) a Lisp hacker who missed them and submitted working patches."3 The actual contributor was Amrit Prem; no specific mention of any Lisp heritage is mentioned in the release notes at the time.The last version released from CWI was Python 1.2. In 1995, van Rossum continued his work on Python at the Corporation For National Research Initiatives (CNRI) in Reston , Virginia where he released several versions of the software. By version 1.4, Python had acquired several new features. Notable among these are the Modula-3 inspired Keyword Argument s (which are also similar to Common Lisp 's keyword arguments), and built-in support for Complex Number s. Also included is a basic form of Data Hiding by Name Mangling , though this is easily bypassed.4 During van Rossum's stay at CNRI, he launched the .5 As Of 2007 , the CP4E project is inactive, and while Python attempts to be easily learnable and not too arcane in its syntax and semantics, reaching out to non-programmers is not an active concern.6 In 2000, the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. CNRI requested that a version 1.6 be released, summarizing Python's development up to the point where the development team left CNRI. Consequently, the release schedules for 1.6 and 2.0 had a significant amount of overlap.7 Python 2.0 was the first and only release from BeOpen.com. After Python 2.0 was released by BeOpen.com, Guido van Rossum and the other PythonLabs developers joined Digital Creations . Python 2.0 borrowed a major feature from the s. Python's syntax for this construct is very similar to Haskell's, apart from Haskell's preference for punctuation characters and Python's preference for alphabetic keywords. Python 2.0 also introduced a Garbage Collection system capable of collecting reference cycles. Following this double release, and after van Rossum left CNRI to work with commercial software developers, it became clear that the ability to use Python with software available under the GPL was very desirable. The license used at that time, the Python License , included a clause stating that the license was governed by the State Of Virginia , which made it, in the view of the Free Software Foundation 's (FSF) lawyers, incompatible with the GNU GPL . CNRI and the FSF interacted to develop wording changes to Python's Free Software License that would make it GPL-compatible. That year (2001), van Rossum was awarded the FSF Award For The Advancement Of Free Software . Python 1.6.1 is essentially the same as Python 1.6, with a few minor bug fixes, and with the new GPL-compatible license.8 Python code.]] Python 2.1 was a derivative work of Python 1.6.1, as well as of Python 2.0. Its license was renamed Python Software Foundation License . All code, documentation and specifications added, from the time of Python 2.1's alpha release on, is owned by the Python Software Foundation (PSF), a non-profit organization formed in 2001, modeled after the Apache Software Foundation . Included in this release (though off by default and not mandatory until several versions later) was an implementation of scoping more similar to Static Scoping rules (of which Scheme is the originator).9 A major innovation in Python 2.2 was the unification of Python's types (types written in C), and classes (types written in Python) into one hierarchy. This single unification made Python's object model purely and consistently object oriented.http://www.python.org/doc/2.2.3/whatsnew/sect-rellinks.html Also added were Generator s which were inspired by Icon .http://www.python.org/doc/2.2.3/whatsnew/node5.html Python's standard library additions and syntactical choices were strongly influenced by parser, introduced in 2.0, and the Decorator syntax that uses @,http://www.python.org/dev/peps/pep-0318/ added in version 2.4http://www.python.org/doc/2.4/whatsnew/node6.htmlFUTURE DEVELOPMENT See Also: Python 3 A Python Enhancement Proposal (or "PEP") is a standardized design document providing general information related to Python, including proposals, descriptions, and explanations for language features. PEPs are intended as the primary channel for proposing new features, and for documenting the underlying design rationale for all major elements of Python.http://www.python.org/dev/peps Outstanding PEPs are reviewed and commented by the BDFL.http://www.python.org/doc/essays/pepparade.html Python developers have an ongoing discussion of a future version called Python 3.0 (the project is called "Python 3000" or "Py3K") that will break backwards compatibility with the 2.x series in order to repair perceived flaws in the language. The guiding principle is to "reduce feature duplication by removing old ways of doing things". There is no definite schedule for Python 3.0, but Python 3.0a1, the first alpha release, was released on August 31 , 2007 , Python 3.0a1 Release and a PEP (Python Enhancement Proposal) that details planned changes exists.http://www.python.org/peps/pep-3000.html USAGE See Also: Python software Some of the largest projects that use Python are the .http://www.python.org/about/success/usa/ Python has also seen extensive use in the TAOF.http://www.theartoffuzzing.com/joomla/ Python is commonly used in exploit development.http://www1.corest.com/files/files/13/CanSecWest2002.pdfhttp://fist.immunitysec.com/pipermail/dailydave/2004-September/000851.html Python has been successfully embedded in a number of software products as a scripting language. It is commonly used in 3D animation packages, as in is now promoting Python as the best choice for writing scripts in ArcGIS 10. It is also used in is also built using python. http://myeve.eve-online.com/devblog.asp?a=blog&bid=488. For many operating systems, Python is a standard component; it ships with most Linux distributions, with FreeBSD, NetBSD, and OpenBSD, and with Mac OS X. Gentoo Linux uses Python in its Package Management system, Portage , and the standard tool to access it, Emerge . Pardus uses it for administration and during system boot.http://www.pardus.org.tr/eng/projects/comar/PythonInPardus.html SYNTAX AND SEMANTICS See Also: Python syntax and semantics Python was designed to be a highly readable language. It aims toward an uncluttered visual layout, using English keywords frequently where other languages use punctuation. Python requires less Boilerplate than traditional statically-typed structured languages such as C or Pascal, and has a smaller number of syntactic exceptions and special cases than either of these. Python uses indentation/whitespace, rather than Curly Braces or keywords, to delimit Statement Block s. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block. Python's statements include:
Each statement has its own semantics: for example, the def statement does not execute its block immediately, unlike most other statements.CPython does not support Continuation s, and according to Guido van Rossum, never will. However, better support for Coroutine -like functionality is provided in 2.5, by extending Python's Generators . Prior to 2.5, generators were Lazy Iterator s — information was passed unidirectionally out of the generator. As of Python 2.5, it is possible to pass information back into a generator function. Python uses Duck Typing , also known as Latent Typing . Type constraints are not checked at Compile Time ; rather, operations on an object may fail, signifying that the given object is not of a suitable type. Despite not enforcing Static Typing , Python is Strongly Typed , forbidding operations which make little sense (for example, adding a number to a string) rather than silently attempting to make sense of them. Python includes a number of built-in types used for a variety of purposes: Python also allows programmers to define their own types. This is in the form of Class es, most often used for an Object-oriented style of programming. New Instance s of classes are constructed by calling the class (ie, like FooClass()), and the classes themselves are instances of class type (itself an instance of itself), allowing Metaprogramming and Reflection .Method s on objects are Function s attached to the object's class; the syntax instance.method(argument) is, for normal methods and functions, Syntactic Sugar for Class.method(instance, argument). This is why Python methods must have an explicit Self parameter to access Instance Data , in contrast to the implicit self in some other object-oriented programming languages (for example, Java , C++ or Ruby ).IMPLEMENTATIONS The mainstream Python implementation, also known as '' and most modern Unix-like systems. CPython was intended from almost its very conception to be cross-platform; its use and development on esoteric platforms such as Amoeba alongside more conventional ones like Unix or Macintosh has greatly helped in this regard.http://www.oreilly.com/pub/a/oreilly/frank/rossum_1099.html Stackless Python is a significant fork of CPython that implements Microthread s. It can be expected to run on approximately the same platforms that CPython runs on. There are two other major implementations: Jython for the Java Platform , and IronPython for the .NET Platform . PyPy is an experimental Self-hosting implementation of Python, in Python, that can output a variety of types of Bytecode , Object Code and Intermediate Language s. Several programs exist to package Python programs into standalone executables, including py2exe , PyInstaller , cx_Freeze and py2app . Many Python programs can run on different Python implementations, on such disparate Operating Systems and execution environments, without change. In the case of the implementations running on top of the Java Virtual Machine or the Common Language Runtime , the platform-independence of these systems is harnessed by their respective Python implementation. Many third-party libraries for Python (and even some first-party ones) are only available on Windows, Linux, BSD, and Mac OS X. In 2005 Nokia released a Python interpreter for Series 60 Mobile Phone s called PyS60 . This includes many of the modules from the regular implementations but also some additional modules for integration with the Symbian operating system. This project has been kept up to date to run on all variants of the S60 platform and there are several third party modules available such as Miso and uitricks Interpretational semantics Most Python implementations (including CPython, the dominant implementation) can function as a Command-line Interpreter , where the user enters statements sequentially and receives the results immediately; in short, acting as a Shell . While the semantics of the other modes of execution (bytecode compilation, or compilation to native code) preserve the sequential semantics, they offer a speed boost at the cost of interactivity, so they are only used outside of a command-line interaction (for example, importing a module). Other shells add capabilities beyond those in the basic interpreter, including IDLE and IPython . While generally following the visual style of the Python shell, they implement features like auto-completion, retention of session state, and syntax highlighting. Some implementations are able to compile to not only bytecode, but to turn Python code into Machine Code . So far, this has only been done for restricted subsets of Python. PyPy takes this approach, naming its restricted compilable version of Python '' RPython ''. Shed Skin is a similar experimental Compiler . Psyco is a Specialising Just In Time Compiler which transforms bytecode to machine code at runtime. The produced code is specialised for certain Data Types . Psyco is compatible with all Python code, not only a subset. Introduction to Psyco STANDARD LIBRARY Python has a large standard library, commonly cited as one of Python's greatest strengths,http://www.oracle.com/technology/pub/articles/piotrowski-pythoncore.html providing tools suited to many disparate tasks. This comes from a so-called "batteries included" philosophy for Python modules. The modules of the standard library can be augmented with custom modules written in either C or Python. Recently, Boost C++ Libraries includes a library, python, to enable interoperability between C++ and Python. Because of the wide variety of tools provided by the standard library combined with the ability to use a lower-level language such as C and C++, which is already capable of interfacing between other libraries, Python can be a powerful Glue Language between languages and tools. The standard library is particularly well tailored to writing Internet-facing applications, with a large number of standard formats and protocols (such as framework for creating exhaustive test suites. Some parts of the standard library are covered by specifications (for example, the WSGI implementation wsgiref follows PEP 333 ), but the majority of modules are defined by nothing other than their code, documentation and test suite. However, because most of the standard library is cross-platform Python code, there are only a small number of modules which must be altered or completely rewritten by alternative implementations.PROGRAMMING PHILOSOPHY Python is a . Python uses Dynamic Typing and Reference Counting for Memory Management . An important feature of Python is dynamic Name Resolution , which binds method and variable names during program execution (also known as Late Binding ). Another target of the language's design is ease of extensibility, rather than having everything built into the language core. New built-in modules are easily written in C or C++ . 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, due to his frustrations with ABC, which espoused the opposite mindset. The design of Python offers limited support for Functional Programming in the Lisp tradition. However, there are significant parallels between the philosophy of Python and that of minimalist Lisp-family languages such as Scheme . The library has two modules (itertools and functools) that implement proven functional tools borrowed from Haskell and Standard ML . http://docs.python.org/lib/module-itertools.html While offering choice in coding methodology, the Python philosophy rejects exuberant syntax, such as in " approach to language design in favor of "there should be one—and preferably only one—obvious way to do it".http://www.python.org/dev/peps/pep-0020/ Like nearly all other languages and their communities, Python does not advocate s can be optimized greatly (a 15-fold optimization of a naive algorithm is recorded without recoding into C), but premature optimization is warned against strongly .http://www.python.org/doc/essays/list2str.html Neologisms A common Neologism in the Python community is '' Pythonic '', which can have a wide range of meanings related to program style. To say that a piece of code is pythonic is to say that it uses Python idioms well; that it is natural or shows fluency in the language. Likewise, to say of an interface or language feature that it is pythonic is to say that it works well with Python idioms; that its use meshes well with the rest of the language. Some people also use the word ''pythonesque'' as a Synonym of 'pythonic'. In contrast, a mark of ''unpythonic'' code is that it attempts to "write C++ (or Lisp, or Perl) code in Python"—that is, provides a rough transcription rather than an idiomatic translation of forms from another language. The concept of pythonicity is tightly bound to Python's minimalist philosophy of readability. Unreadable code or incomprehensible idioms are unpythonic. Users and admirers of Python—most especially those considered knowledgeable or experienced—are often referred to as ''Pythonists'', ''Pythonistas'', and ''Pythoneers''. The prefix ''Py-'' can be used to show that something is related to Python. Examples of the use of this prefix in names of Python applications or libraries include is named PyCon . An important goal of the Python developers is making Python fun to use. This is reflected in the origin of the name (after the television series ''s often used in Python literature are ''spam'' And ''eggs'' , instead of the traditional ''foo'' And ''bar'' . INFLUENCES ON OTHER LANGUAGES Python's design and philosophy have influenced several programming languages:
Python's development practices have also been emulated by other languages. The system of requiring a document describing the rationale for and issues surrounding a change to the language (ie, a PEP) is also used in Tcl directly due to Python's influence.http://www.tcl.tk/cgi-bin/tct/tip/3.html SEE ALSO
NOTES AND REFERENCES EXTERNAL LINKS |
|
|