SUPPORT THE WORK

GetWiki

Python (programming language)

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
Python (programming language)
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Short description|General-purpose programming language}}{{Use dmy dates|date=November 2021}}







factoids
Procedural programming (Imperative programming>imperative), Functional programming, Structured programming>structured, reflectivePUBLISHER=ALT.SOURCES ARCHIVES ARCHIVE-DATE=11 AUGUST 2021 URL-STATUS=LIVE, | designer = Guido van Rossum| developer = Python Software FoundationpropertyP548=Q2804309|P348}}propertyreferenceP348}}Duck typing>duck, Dynamic typing, Strong and weak typing>strong;WHY IS PYTHON A DYNAMIC LANGUAGE AND ALSO A STRONGLY TYPED LANGUAGE >URL=HTTPS://WIKI.PYTHON.ORG/MOIN/WHY%20IS%20PYTHON%20A%20DYNAMIC%20LANGUAGE%20AND%20ALSO%20A%20STRONGLY%20TYPED%20LANGUAGEWEBSITE=PYTHON WIKI ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20210314173706/HTTPS://WIKI.PYTHON.ORG/MOIN/WHY%20IS%20PYTHON%20A%20DYNAMIC%20LANGUAGE%20AND%20ALSO%20A%20STRONGLY%20TYPED%20LANGUAGEOptional typing>optional type annotations (since 3.5, but those hints are ignored, except with unofficial tools)HTTPS://WWW.PYTHON.ORG/DEV/PEPS/PEP-0483/>TITLE=PEP 483 – THE THEORY OF TYPE HINTSACCESS-DATE=14 JUNE 2018ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20200614153558/HTTPS://WWW.PYTHON.ORG/DEV/PEPS/PEP-0483/, live, | implementations = CPython, PyPy, Stackless Python, MicroPython, CircuitPython, IronPython, JythonTier 1: 64-bit Linux, macOS; 64- and 32-bit Windows 10+PEP 11 – CPYTHON PLATFORM SUPPORT {{!, peps.python.org access-date=2024-04-22 language=en}}Tier 2: E.g. 32-bit WebAssembly (WASI) Tier 3: 64-bit FreeBSD, iOS; e.g. Raspberry Pi OSUnofficial (or has been known to work): Other Unix-like/Berkeley Software Distribution variants and e.g. Android (operating system)>Android 5.0+ (official from Python 3.13 plannedPEP 738 – ADDING ANDROID AS A SUPPORTED PLATFORM {{!, peps.python.org >url=https://peps.python.org/pep-0738/ website=Python Enhancement Proposals (PEPs) ACCESS-DATE=2023-08-18 LANGUAGE=EN ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20201127015815/HTTPS://WWW.PYTHON.ORG/DOWNLOAD/OTHER/ ACCESS-DATE=2022-05-17 ARCHIVE-DATE=17 MAY 2022 URL-STATUS=LIVE, PLATFORM – ACCESS TO UNDERLYING PLATFORM’S IDENTIFYING DATA – PYTHON 3.10.4 DOCUMENTATION >URL=HTTPS://DOCS.PYTHON.ORG/3/LIBRARY/PLATFORM.HTML?HIGHLIGHT=ANDROID WEBSITE=DOCS.PYTHON.ORG ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20220517150826/HTTPS://DOCS.PYTHON.ORG/3/LIBRARY/PLATFORM.HTML?HIGHLIGHT=ANDROID, live, | license = Python Software Foundation LicenseFIRST=MOORE ACCESS-DATE=12 NOVEMBER 2015 ARCHIVE-DATE=26 DECEMBER 2018 URL-STATUS=LIVE, .pyi, .pyc, .pydwww.python.org/|python.org}}Cython, PyPy#RPython>RPython, Bazel (software)STARLARK LANGUAGEACCESS-DATE=25 MAY 2019ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20200615140534/HTTPS://DOCS.BAZEL.BUILD/VERSIONS/MASTER/SKYLARK/LANGUAGE.HTML, live, ABC (programming language)>ABC, Ada (programming language),HTTP://ARCHIVE.ADAIC.COM/STANDARDS/83LRM/HTML/LRM-11-03.HTML#11.3 ACCESS-DATE=7 JANUARY 2020 ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20191022155758/HTTP://ARCHIVE.ADAIC.COM/STANDARDS/83LRM/HTML/LRM-11-03.HTML#11.3 ALGOL 68, APL (programming language)>APL,HTTPS://DOCS.PYTHON.ORG/3/LIBRARY/ITERTOOLS.HTML>TITLE=ITERTOOLS – FUNCTIONS CREATING ITERATORS FOR EFFICIENT LOOPING – PYTHON 3.7.1 DOCUMENTATIONACCESS-DATE=22 NOVEMBER 2016ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20200614153629/HTTPS://DOCS.PYTHON.ORG/3/LIBRARY/ITERTOOLS.HTML URL-STATUS=LIVE, C (programming language), C++, CLU (programming language)>CLU, Dylan (programming language), Haskell, Icon (programming language)>Icon, Lisp (programming language), {{nowrap>Modula-3}},{{rPerl,RE – REGULAR EXPRESSION OPERATIONS – PYTHON 3.10.6 DOCUMENTATION WEBSITE=DOCS.PYTHON.ORG QUOTE=THIS MODULE PROVIDES REGULAR EXPRESSION MATCHING OPERATIONS SIMILAR TO THOSE FOUND IN PERL. ARCHIVE-URL=HTTPS://WEB.ARCHIVE.ORG/WEB/20180718132241/HTTPS://DOCS.PYTHON.ORG/3/LIBRARY/RE.HTML, live, Standard MLApache Groovy, Boo (programming language)>Boo, Cobra (programming language), CoffeeScript,HTTPS://COFFEESCRIPT.ORG/WEBSITE=COFFEESCRIPT.ORGARCHIVE-DATE=12 JUNE 2020URL-STATUS=LIVE, D (programming language), F Sharp (programming language)>F#, Godot (game engine)#GDScript, Genie (programming language)>Genie,WEB,wiki.gnome.org/action/show/Projects/Genie, The Genie Programming Language Tutorial, 28 February 2020, 1 June 2020,web.archive.org/web/20200601133216/https://wiki.gnome.org/action/show/Projects/Genie, live, Go, JavaScript,WEB, Perl and Python influences in JavaScript, 24 February 2013, www.2ality.com,www.2ality.com/2013/02/javascript-influences.html, 15 May 2015, 26 December 2018,2ality.com/2013/02/javascript-influences.html%0A," title="web.archive.org/web/201812261411212ality.com/2013/02/javascript-influences.html%0A,">web.archive.org/web/201812261411212ality.com/2013/02/javascript-influences.html%0A, live, WEB, Chapter 3: The Nature of JavaScript; Influences, Rauschmayer, Axel, O’Reilly, Speaking JavaScript,speakingjs.com/es5/ch03.html, 15 May 2015, 26 December 2018,speakingjs.com/es5/ch03.html%0A," title="web.archive.org/web/20181226141123speakingjs.com/es5/ch03.html%0A,">web.archive.org/web/20181226141123speakingjs.com/es5/ch03.html%0A, live, Julia, Mojo,WEB, Krill, Paul, 2023-05-04, Mojo language marries Python and MLIR for AI development,www.infoworld.com/article/3695588/mojo-language-marries-python-and-mlir-for-ai-development.html, 2023-05-05, InfoWorld, en, 5 May 2023,web.archive.org/web/20230505064554/https://www.infoworld.com/article/3695588/mojo-language-marries-python-and-mlir-for-ai-development.html, live, Nim, Ring,WEB,ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages, Ring and other languages, Ring Team, 4 December 2017, ring-lang.net, ring-lang, 4 December 2017, 25 December 2018,ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages," title="web.archive.org/web/20181225175312ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages,">web.archive.org/web/20181225175312ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages, live, Ruby, SwiftWEB,nondot.org/sabre/, Chris Lattner’s Homepage, Lattner, Chris, 3 June 2014, 3 June 2014, Chris Lattner, The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list., 25 December 2018,nondot.org/sabre/," title="web.archive.org/web/20181225175312nondot.org/sabre/,">web.archive.org/web/20181225175312nondot.org/sabre/, live, | wikibooks = Python Programming}}Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming. It is often described as a “batteries included” language due to its comprehensive standard library.WEB, PEP 206 – Python Advanced Library,www.python.org/dev/peps/pep-0206/, live,web.archive.org/web/20210505003659/https://www.python.org/dev/peps/pep-0206/, 5 May 2021, 11 October 2021, Python.org, Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language and first released it in 1991 as Python 0.9.0.WEB, Rossum, Guido Van, 2009-01-20, The History of Python: A Brief Timeline of Python,python-history.blogspot.com/2009/01/brief-timeline-of-python.html, 2021-03-05, The History of Python, 5 June 2020,web.archive.org/web/20200605032200/https://python-history.blogspot.com/2009/01/brief-timeline-of-python.html, live, Python 2.0 was released in 2000. Python 3.0, released in 2008, was a major revision not completely backward-compatible with earlier versions. Python 2.7.18, released in 2020, was the last release of Python 2.WEB,pythoninsider.blogspot.com/2020/04/python-2718-last-release-of-python-2.html, Python 2.7.18, the last release of Python 2, Peterson, Benjamin, 20 April 2020, Python Insider, 27 April 2020, 26 April 2020,web.archive.org/web/20200426204118/https://pythoninsider.blogspot.com/2020/04/python-2718-last-release-of-python-2.html, live, Python consistently ranks as one of the most popular programming languages, and has gained widespread use in the machine learning community.WEB, Stack Overflow Developer Survey 2022,survey.stackoverflow.co/2022/, 2022-08-12, Stack Overflow, en, 27 June 2022,web.archive.org/web/20220627175307/https://survey.stackoverflow.co/2022/, live, WEB, The State of Developer Ecosystem in 2020 Infographic,www.jetbrains.com/lp/devecosystem-2020/, 2021-03-05, JetBrains: Developer Tools for Professionals and Teams, en, 1 March 2021,web.archive.org/web/20210301062411/https://www.jetbrains.com/lp/devecosystem-2020/, live, WEB, TIOBE Index, TIOBE,www.tiobe.com/tiobe-index/, 3 January 2023, The TIOBE Programming Community index is an indicator of the popularity of programming languages, 25 February 2018,web.archive.org/web/20180225101948/https://www.tiobe.com/tiobe-index/, live, Updated as required.WEB, PYPL PopularitY of Programming Language index,pypl.github.io/PYPL.html, 2021-03-26, pypl.github.io, en, 14 March 2017,web.archive.org/web/20170314232030/https://pypl.github.io/PYPL.html, live,

History

File:Guido van Rossum OSCON 2006 cropped.png|thumb|150px|The designer of Python, Guido van Rossum, at OSCON 2006]]Python was invented in the late 1980s by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC programming language, which was inspired by SETL, capable of exception handling and interfacing with the Amoeba operating system. Its implementation began in December 1989. Van Rossum shouldered sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his “permanent vacation” from his responsibilities as Python’s “benevolent dictator for life” (BDFL), a title the Python community bestowed upon him to reflect his long-term commitment as the project’s chief decision-maker (he’s since come out of retirement and is self-titled “BDFL-emeritus“). In January 2019, active Python core developers elected a five-member Steering Council to lead the project.WEB, PEP 8100,www.python.org/dev/peps/pep-8100/, Python Software Foundation, 4 May 2019, 4 June 2020,web.archive.org/web/20200604235027/https://www.python.org/dev/peps/pep-8100/, live, WEB, PEP 13 – Python Language Governance,www.python.org/dev/peps/pep-0013/, 2021-08-25, Python.org, en, 27 May 2021,web.archive.org/web/20210527000035/https://www.python.org/dev/peps/pep-0013/, live, Python 2.0 was released on 16 October 2000, with many major new features such as list comprehensions, cycle-detecting garbage collection, reference counting, and Unicode support. Python 3.0, released on 3 December 2008, with many of its major features backported to Python 2.6.x and 2.7.x. Releases of Python 3 include the 2to3 utility, which automates the translation of Python 2 code to Python 3.WEB, 2to3 – Automated Python 2 to 3 code translation,docs.python.org/3/library/2to3.html, 2021-02-02, docs.python.org, 4 June 2020,web.archive.org/web/20200604232823/https://docs.python.org/3/library/2to3.html, live, Python 2.7’s end-of-life was initially set for 2015, then postponed to 2020 out of concern that a large body of existing code could not easily be forward-ported to Python 3.WEB,legacy.python.org/dev/peps/pep-0373/, PEP 373 – Python 2.7 Release Schedule, python.org, 9 January 2017, 19 May 2020,web.archive.org/web/20200519075520/https://legacy.python.org/dev/peps/pep-0373/, live, WEB,www.python.org/dev/peps/pep-0466/, PEP 466 – Network Security Enhancements for Python 2.7.x, python.org, 9 January 2017, 4 June 2020,web.archive.org/web/20200604232833/https://www.python.org/dev/peps/pep-0466/, live, No further security patches or other improvements will be released for it.WEB,www.python.org/doc/sunset-python-2/, Sunsetting Python 2, Python.org, en, 22 September 2019, 12 January 2020,web.archive.org/web/20200112080903/https://www.python.org/doc/sunset-python-2/, live, WEB,www.python.org/dev/peps/pep-0373/, PEP 373 – Python 2.7 Release Schedule, Python.org, en, 22 September 2019, 13 January 2020,web.archive.org/web/20200113033257/https://www.python.org/dev/peps/pep-0373/, live, Currently only 3.8 and later are supported (2023 security issues were fixed in e.g. 3.7.17, the final 3.7.x releaseWEB, Python Release Python 3.7.17,www.python.org/downloads/release/python-3717/, 2023-08-18, Python.org, en, 31 July 2023,web.archive.org/web/20230731174749/https://www.python.org/downloads/release/python-3717/, live, ). While Python 2.7 and older is officially unsupported, a different unofficial Python implementation, PyPy, continues to support Python 2, i.e. “2.7.18+” (plus 3.9 and 3.10), with the plus meaning (at least some) “backported security updates”.WEB, mattip, 2023-12-25, PyPy v7.3.14 release,www.pypy.org/posts/2023/12/pypy-v7314-release.html, 2024-01-05, PyPy, en, 5 January 2024,web.archive.org/web/20240105132820/https://www.pypy.org/posts/2023/12/pypy-v7314-release.html, live, In 2021 (and again twice in 2022), security updates were expedited, since all Python versions were insecure (including 2.7WEB, CVE-2021-3177,access.redhat.com/security/cve/cve-2021-3177, 2021-02-26, Red Hat Customer Portal, 6 March 2021,web.archive.org/web/20210306183700/https://access.redhat.com/security/cve/cve-2021-3177, live, ) because of security issues leading to possible remote code executionWEB, CVE-2021-3177,cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177, 2021-02-26, CVE, 27 February 2021,web.archive.org/web/20210227192918/https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177, live, and web-cache poisoning.WEB, CVE-2021-23336,cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23336, 2021-02-26, CVE, 24 February 2021,web.archive.org/web/20210224160700/https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23336, live, In 2022, Python 3.10.4 and 3.9.12 were expeditedWEB, Langa, Łukasz, 2022-03-24, Python 3.10.4 and 3.9.12 are now available out of schedule,pythoninsider.blogspot.com/2022/03/python-3104-and-3912-are-now-available.html, 2022-04-19, Python Insider, 21 April 2022,web.archive.org/web/20220421205820/https://pythoninsider.blogspot.com/2022/03/python-3104-and-3912-are-now-available.html, live, and 3.8.13, because of many security issues.WEB, Langa, Łukasz, 2022-03-16, Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 are now available with security content,pythoninsider.blogspot.com/2022/03/python-3103-3911-3813-and-3713-are-now.html, 2022-04-19, Python Insider, 17 April 2022,web.archive.org/web/20220417215022/https://pythoninsider.blogspot.com/2022/03/python-3103-3911-3813-and-3713-are-now.html, live, When Python 3.9.13 was released in May 2022, it was announced that the 3.9 series (joining the older series 3.8 and 3.7) would only receive security fixes in the future.WEB, Langa, Łukasz, 2022-05-17, Python 3.9.13 is now available,pythoninsider.blogspot.com/2022/05/python-3913-is-now-available.html, 2022-05-21, Python Insider, 17 May 2022,web.archive.org/web/20220517173546/https://pythoninsider.blogspot.com/2022/05/python-3913-is-now-available.html, live, On 7 September 2022, four new releases were made due to a potential denial-of-service attack: 3.10.7, 3.9.14, 3.8.14, and 3.7.14.WEB, Python releases 3.10.7, 3.9.14, 3.8.14, and 3.7.14 are now available, Python Insider, Łukasz, Langa, 7 September 2022, 16 September 2022,pythoninsider.blogspot.com/2022/09/python-releases-3107-3914-3814-and-3714.html, 13 September 2022,web.archive.org/web/20220913001104/https://pythoninsider.blogspot.com/2022/09/python-releases-3107-3914-3814-and-3714.html, live, WEB, CVE-2020-10735, CVE, 16 September 2022,cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735, 20 September 2022,web.archive.org/web/20220920170528/https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735, live, {{As of|2023|10|post=,}} Python 3.12 is the stable release, and 3.12 and 3.11 are the only versions with active (as opposed to just security) support. Notable changes in 3.11 from 3.10 include increased program execution speed and improved error reporting.WEB, Python 3.11 released [LWN.net], corbet, lwn.net, 24 October 2022, 15 November 2022,lwn.net/Articles/912216/, Python 3.12 adds syntax (and in fact every Python since at least 3.5 adds some syntax) to the language, the new (soft) keyword type (recent releases have added a lot of typing support e.g. new type union operator in 3.10), and 3.11 for exception handling, and 3.10 the match and case (soft) keywords, for structural pattern matching statements. Python 3.12 also drops outdated modules and functionality, and future versions will too, see below in Development section.Python 3.11 claims to be between 10 and 60% faster than Python 3.10, and Python 3.12 adds another 5% on top of that. It also has improved error messages, and many other changes.{{As of|2023|June|27|since=y}}, Python 3.8 is the oldest supported version of Python (albeit in the ‘security support’ phase), due to Python 3.7 reaching end-of-life.WEB, 2023-08-10, Python,endoflife.date/python, 2023-08-15, endoflife.date, en-US, 18 September 2021,web.archive.org/web/20210918162455/https://endoflife.date/python, live, Python 3.13 introduced an incremental (shorter pauses) garbage collector, an experimental JIT compiler;WEB, What’s New In Python 3.13,docs.python.org/3.13/whatsnew/3.13.html#experimental-jit-compiler, 2024-04-30, Python documentation, en, , and removals from the C API. Some standard library modules, 19 dead batteries, and many deprecated classes, functions and methods, and more will be removed in Python 3.15 and or 3.16.WEB, Wouters, Thomas, 2024-04-09, Python Insider: Python 3.12.3 and 3.13.0a6 released,pythoninsider.blogspot.com/2024/04/python-3123-and-3130a6-released.html, 2024-04-29, Python Insider, Starting with 3.13, it and later versions have 2 years of full support (up from one and a half); followed by 3 years of security support (for same total support as before).

Design philosophy and features

Python is a multi-paradigm programming language. Object-oriented programming and structured programming are fully supported, and many of their features support functional programming and aspect-oriented programming (including metaprogramming and metaobjects). Many other paradigms are supported via extensions, including design by contract and logic programming.Python uses dynamic typing and a combination of reference counting and a cycle-detecting garbage collector for memory management.WEB,docs.python.org/extending/extending.html#reference-counts, Extending and Embedding the Python Interpreter: Reference Counts, Docs.python.org, en, 5 June 2020, Since Python makes heavy use of malloc() and free(), it needs a strategy to avoid memory leaks as well as the use of freed memory. The chosen method is called reference counting., 18 October 2012,docs.python.org/extending/extending.html#reference-counts," title="web.archive.org/web/20121018063230docs.python.org/extending/extending.html#reference-counts,">web.archive.org/web/20121018063230docs.python.org/extending/extending.html#reference-counts, live, It uses dynamic name resolution (late binding), which binds method and variable names during program execution.Its design offers some support for functional programming in the Lisp tradition. It has {{codes|filter|map|reduce|d=and}} functions; list comprehensions, dictionaries, sets, and generator expressions. The standard library has two modules ({{codes|itertools}} and {{codes|functools}}) that implement functional tools borrowed from Haskell and Standard ML.Its core philosophy is summarized in the Zen of Python (PEP 20), which includes aphorisms such as:
  • Beautiful is better than ugly.
  • Explicit is better than implicit.
  • Simple is better than complex.
  • Complex is better than complicated.
  • Readability counts.
However, Python features regularly violate these principles and received criticism for adding unnecessary language bloat.WEB,learning-python.com/python-changes-2014-plus.html, Python Changes 2014+, Lutz, Mark, January 2022, Learning Python, 2024-02-25, 15 March 2024,web.archive.org/web/20240315075935/https://learning-python.com/python-changes-2014-plus.html, live, WEB,gist.github.com/RobertAKARobin/a1cba47d62c009a378121398cc5477ea, Python is not a great programming language, Thomas, Robin, 2023-05-03, GitHub Gist, 2024-02-25, 31 December 2023,web.archive.org/web/20231231092949/https://gist.github.com/RobertAKARobin/a1cba47d62c009a378121398cc5477ea, live, Responses to these criticisms are that the Zen of Python is a guideline rather than a rule.WEB,discuss.python.org/t/confusion-regarding-a-rule-in-the-zen-of-python/15927, Confusion regarding a rule in The Zen of Python, 2022-05-03, Python Help - Discussions on Python.org, 2024-02-25, 25 February 2024,web.archive.org/web/20240225221142/https://discuss.python.org/t/confusion-regarding-a-rule-in-the-zen-of-python/15927, live, The addition of some new features had been so controversial that Guido van Rossum resigned as Benevolent Dictator for Life following vitriol over the addition of the assignment expression operator in Python 3.8.WEB,pythonsimplified.com/the-most-controversial-python-walrus-operator/, The Most Controversial Python Walrus Operator, Ambi, Chetan, 2021-07-04, Python Simplified, 2024-02-05, 27 August 2023,web.archive.org/web/20230827154931/https://pythonsimplified.com/the-most-controversial-python-walrus-operator/, live, WEB,therenegadecoder.com/code/the-controversy-behind-the-walrus-operator-in-python/, The Controversy Behind The Walrus Operator in Python, Grifski, Jeremy, 2020-05-24, The Renegade Coder, 2024-02-25, 28 December 2023,web.archive.org/web/20231228135749/https://therenegadecoder.com/code/the-controversy-behind-the-walrus-operator-in-python/, live, Nevertheless, rather than building all of its functionality into its core, Python was designed to be highly extensible via modules. This compact modularity has made it particularly popular as a means of adding programmable interfaces to existing applications. Van Rossum’s vision of a small core language with a large standard library and easily extensible interpreter stemmed from his frustrations with ABC, which espoused the opposite approach.Python claims to strive for a simpler, less-cluttered syntax and grammar while giving developers a choice in their coding methodology. In contrast to Perl’s “there is more than one way to do it” motto, Python embraces a “there should be one—and preferably only one—obvious way to do it.” philosophy. In practice, however, Python provides many ways to achieve the same task. There are, for example, at least three ways to format a string literal, with no certainty as to which one a programmer should use.WEB,realpython.com/python-string-formatting/, Python String Formatting Best Practices, Bader, Dan, Real Python, 2024-02-25, 18 February 2024,web.archive.org/web/20240218083506/https://realpython.com/python-string-formatting/, live, Alex Martelli, a Fellow at the Python Software Foundation and Python book author, wrote: “To describe something as ‘clever’ is not considered a compliment in the Python culture.“Python’s developers usually strive to avoid premature optimization and reject patches to non-critical parts of the CPython reference implementation that would offer marginal increases in speed at the cost of clarity. Execution speed can be improved by moving speed-critical functions to extension modules written in languages such as C, or by using a just-in-time compiler like PyPy. It is also possible to cross-compile to other languages, but it either doesn’t provide the full speed-up that might be expected, since Python is a very dynamic language, or a restricted subset of Python is compiled, and possibly semantics are slightly changed.Python’s developers aim for it to be fun to use. This is reflected in its name—a tribute to the British comedy group Monty Python—and in occasionally playful approaches to tutorials and reference materials, such as the use of the terms “spam” and “eggs” (a reference to a Monty Python sketch) in examples, instead of the often-used “foo” and “bar”.WEB,insidetech.monster.com/training/articles/8114-15-ways-python-is-a-powerful-force-on-the-web, 15 Ways Python Is a Powerful Force on the Web, 3 July 2018, 11 May 2019,insidetech.monster.com/training/articles/8114-15-ways-python-is-a-powerful-force-on-the-web," title="web.archive.org/web/20190511065650insidetech.monster.com/training/articles/8114-15-ways-python-is-a-powerful-force-on-the-web,">web.archive.org/web/20190511065650insidetech.monster.com/training/articles/8114-15-ways-python-is-a-powerful-force-on-the-web, dead, WEB, pprint – Data pretty printer – Python 3.11.0 documentation,docs.python.org/3/library/pprint.html, 2022-11-05, docs.python.org, stuff=[’spam’, ‘eggs’, ‘lumberjack’, ‘knights’, ‘ni’], 22 January 2021,web.archive.org/web/20210122224848/https://docs.python.org/3/library/pprint.html, live, A common neologism in the Python community is pythonic, which has a wide range of meanings related to program style. “Pythonic” code may use Python idioms well, be natural or show fluency in the language, or conform with Python’s minimalist philosophy and emphasis on readability. Code that is difficult to understand or reads like a rough transcription from another programming language is called unpythonic.WEB,towardsdatascience.com/how-to-be-pythonic-and-why-you-should-care-188d63a5037e, How to be Pythonic and why you should care, Robert, Clark, 26 April 2019, Medium, 20 January 2021, 13 August 2021,web.archive.org/web/20210813194313/https://towardsdatascience.com/how-to-be-pythonic-and-why-you-should-care-188d63a5037e?gi=dd6bc15118b3, live, WEB,docs.python-guide.org/writing/style, Code Style – The Hitchhiker’s Guide to Python, docs.python-guide.org, 20 January 2021, 27 January 2021,web.archive.org/web/20210127154341/https://docs.python-guide.org/writing/style/, live,

Syntax and semantics

Python is meant to be an easily readable language. Its formatting is visually uncluttered and often uses English keywords where other languages use punctuation. Unlike many other languages, it does not use curly brackets to delimit blocks, and semicolons after statements are allowed but rarely used. It has fewer syntactic exceptions and special cases than C or Pascal.

Indentation

Python uses whitespace indentation, rather than curly brackets or keywords, to delimit blocks. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block. Thus, the program’s visual structure accurately represents its semantic structure.BOOK, MIT Press, 978-0-262-52962-4, Guttag, John V., Introduction to Computation and Programming Using Python: With Application to Understanding Data, 12 August 2016, This feature is sometimes termed the off-side rule. Some other languages use indentation this way; but in most, indentation has no semantic meaning. The recommended indent size is four spaces.WEB,www.python.org/dev/peps/pep-0008/, PEP 8 – Style Guide for Python Code, Python.org, 26 March 2019, 17 April 2019,web.archive.org/web/20190417223549/https://www.python.org/dev/peps/pep-0008/, live,

Statements and control flow

Python’s statements include:
  • The assignment statement, using a single equals sign =
  • The if statement, which conditionally executes a block of code, along with else and elif (a contraction of else-if)
  • The for statement, which iterates over an iterable object, capturing each element to a local variable for use by the attached block
  • The while statement, which executes a block of code as long as its condition is true
  • The try statement, which allows exceptions raised in its attached code block to be caught and handled by except clauses (or new syntax except in Python 3.11 for exception groupsWEB, 8. Errors and Exceptions – Python 3.12.0a0 documentation,docs.python.org/3.11/tutorial/errors.html, 2022-05-09, docs.python.org, 9 May 2022,web.archive.org/web/20220509145745/https://docs.python.org/3.11/tutorial/errors.html, live, ); it also ensures that clean-up code in a finally block is always run regardless of how the block exits
  • The raise statement, used to raise a specified exception or re-raise a caught exception
  • The class statement, which executes a block of code and attaches its local namespace to a class, for use in object-oriented programming
  • The def statement, which defines a function or method
  • The with statement, which encloses a code block within a context manager (for example, acquiring a lock before it is run, then releasing the lock; or opening and closing a file), allowing resource-acquisition-is-initialization (RAII)-like behavior and replacing a common try/finally idiomWEB,www.python.org/download/releases/2.5/highlights/, Highlights: Python 2.5, Python.org, 20 March 2018, 4 August 2019,web.archive.org/web/20190804120408/https://www.python.org/download/releases/2.5/highlights/, live,
  • The break statement, which exits a loop
  • The continue statement, which skips the rest of the current iteration and continues with the next
  • The del statement, which removes a variable—deleting the reference from the name to the value, and producing an error if the variable is referred to before it is redefined
  • The pass statement, serving as a NOP, syntactically needed to create an empty code block
  • The assert statement, used in debugging to check for conditions that should apply
  • The yield statement, which returns a value from a generator function (and also an operator); used to implement coroutines
  • The return statement, used to return a value from a function
  • The import and from statements, used to import modules whose functions or variables can be used in the current program
The assignment statement (=) binds a name as a reference to a separate, dynamically allocated object. Variables may subsequently be rebound at any time to any object. In Python, a variable name is a generic reference holder without a fixed data type; however, it always refers to some object with a type. This is called dynamic typing—in contrast to statically-typed languages, where each variable may contain only a value of a certain type.Python does not support tail call optimization or first-class continuations, and, according to Van Rossum, it never will. However, better support for coroutine-like functionality is provided by extending Python’s generators. Before 2.5, generators were lazy iterators; data was passed unidirectionally out of the generator. From Python 2.5 on, it is possible to pass data back into a generator function; and from version 3.3, it can be passed through multiple stack levels.

Expressions

Python’s expressions include:

- content above as imported from Wikipedia
- "Python (programming language)" does not exist on GetWiki (yet)
- time: 9:28am EDT - Wed, May 22 2024
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 21 MAY 2024
GETWIKI 09 JUL 2019
Eastern Philosophy
History of Philosophy
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
CONNECT