History of Python: Difference between revisions

Content deleted Content added
top: Lifted from the BDFL page, but appropriate here
added mention of the prominent and often confusing raw_input/input function change
Tag: Newer user possibly adding unreferenced or improperly referenced material
Line 73:
 
* Changing <code>print</code> so that it is a built-in function, not a statement. This made it easier to change a module to use a different print function, as well as making the syntax more regular. In Python 2.6 and 2.7 <code>print()</code> is available as a builtin but is masked by the print statement syntax, which can be disabled by entering <code>from __future__ import print_function</code> at the top of the file. <ref>{{cite web|url=https://www.python.org/dev/peps/pep-3105/|title=PEP 3105 -- Make print a function|author=|date=|work=python.org|accessdate=December 27, 2016}}</ref>
* Unifying the <code>raw_input</code> and <code>input</code> functions into a single <code>input</code> function. Python 3's <code>input</code> function behaves like Python 2's <code>raw_input</code> function, in that the input is always returned as a string rather than being interpreted as an expression.
* Moving <code>reduce</code> (but not <code>map</code> or <code>filter</code>) out of the built-in namespace and into functools (the rationale being that operations using ''reduce'' are expressed more clearly using an accumulation loop);<ref>{{cite web|url=http://www.artima.com/weblogs/viewpost.jsp?thread=211200|title=Python 3000 FAQ|first=Guido van van|last=Rossum|date=|work=artima.com|accessdate=December 27, 2016}}</ref>
* Adding support for optional function annotations that can be used for informal type declarations or other purposes;<ref>{{cite web|url=https://www.python.org/dev/peps/pep-3107/|title=PEP 3107 -- Function Annotations|author=|date=|work=python.org|accessdate=December 27, 2016}}</ref>