Content deleted Content added
Changed spelling of centre to center |
Built-in instead of builtin |
||
Line 68:
Some of the major changes included for Python 3.0 were:
* Changing {{code|print}} so that it is a [[Intrinsic function|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()}} is available as a
* Removal of the Python 2 {{code|input}} function, and the renaming of the {{code|raw_input}} function to {{code|input}}. Python 3's {{code|input}} function behaves like Python 2's {{code|raw_input}} function, in that the input is always returned as a string rather than being evaluated as an expression
* Moving {{code|reduce}} (but not {{code|map}} or {{code|filter}}) out of the built-in namespace and into {{code|functools}} (the rationale being code that uses {{code|reduce}} is less readable than code that uses a for loop and accumulator variable)<ref>{{cite web |url=http://www.artima.com/weblogs/viewpost.jsp?thread=211200 |title=Python 3000 FAQ |first=Guido |last=van Rossum |work=artima.com |access-date=December 27, 2016 |archive-date=November 9, 2020 |archive-url=https://web.archive.org/web/20201109015427/https://www.artima.com/weblogs/viewpost.jsp?thread=211200 |url-status=live}}</ref><ref>{{Cite web |url=https://www.artima.com/weblogs/viewpost.jsp?thread=98196 |title=The fate of reduce() in Python 3000 |website=www.artima.com |access-date=2019-12-31 |archive-date=December 18, 2019 |archive-url=https://web.archive.org/web/20191218204011/https://www.artima.com/weblogs/viewpost.jsp?thread=98196 |url-status=live}}</ref>
|