classification
Title: Python: Not just OO style but this is not mentioned on python.org or in FAQ
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: Paddy McCarthy, brett.cannon, docs@python, miss-islington, terry.reedy
Priority: normal Keywords: patch

Created on 2015-08-22 06:45 by Paddy McCarthy, last changed 2020-06-08 18:53 by brett.cannon. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20658 merged brett.cannon, 2020-06-05 19:24
PR 20737 merged miss-islington, 2020-06-08 18:08
PR 20738 merged miss-islington, 2020-06-08 18:08
Messages (6)
msg248987 - (view) Author: Paddy McCarthy (Paddy McCarthy) Date: 2015-08-22 06:45
Just read http://www.ibmsystemsmag.com/ibmi/developer/general/different-world-python/?utm_campaign=ibm-enews&utm_medium=email&utm_source=ibmi-jul22-2015?&utm_content=exclusive1-headline

It states that they could have had an officially supported version of Python on that IBM platform much earlier but for this:

> "The second was that everything we read on Python, and all the examples we encountered, led us to believe that it was a completely object oriented (OO) language"

They may have used it earlier had they known then that Python can be written in a procedural style they having no love of Java's OO, but being able to use PHP and access PHP's OO bits.

Looking again on python.org, the examples are not OO, but when you delve down, say to the FAQ - it gives the mistaken impression that OO is the _only_ style of programming supported: https://docs.python.org/2/faq/general.html#what-is-python

Somehow we need to explain that OO is an implementation style, but the language allows code to be written in just as much - or as little, of proceedural/OO/functional styles as the programmer is comfortable with.
msg248999 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2015-08-23 01:45
The problem is that technically Python is an object-oriented language as everything is a language (which is what makes Python more OO than Java). Having said that, you can use other programming styles. I'm fine with clarifying the entry in the FAQ that Python can be written in other programming styles such as procedural or functional. If you have suggested wording, Paddy, please feel free to propose a patch.
msg249001 - (view) Author: Paddy McCarthy (Paddy McCarthy) Date: 2015-08-23 06:52
OK, here's a suggested re-wording:

"Python is an interpreted, interactive, object-oriented programming language that also supports programming in procedural and functional styles. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes; but statements are not required to be contained in class definitions and functions are first class - being able to be composed, returned from other functions and be a member of other container types such as dicts, sets, and lists."

If that is too long,an alternative would be to delete my addition to the last sentence from "; but classes are not ..." Leaving it to the reader to research just how procedural and functional Python can be. (Where should a programmer, but newbie-to-Python look)?
msg371034 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2020-06-08 18:07
New changeset 3ab3475c42c8ee5580f4ea1aeda73ebc8e5d5478 by Brett Cannon in branch 'master':
bpo-24914: mention Python supports multiple paradigms in the FAQ (#20658)
https://github.com/python/cpython/commit/3ab3475c42c8ee5580f4ea1aeda73ebc8e5d5478
msg371038 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2020-06-08 18:53
New changeset 14073c509058f8efeb5ea7f7693bf84f410d24b7 by Miss Islington (bot) in branch '3.8':
bpo-24914: mention Python supports multiple paradigms in the FAQ (GH-20658) (GH-20738)
https://github.com/python/cpython/commit/14073c509058f8efeb5ea7f7693bf84f410d24b7
msg371039 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2020-06-08 18:53
New changeset b155381314c632e7dd452fbade3903e58657cfc7 by Miss Islington (bot) in branch '3.9':
bpo-24914: mention Python supports multiple paradigms in the FAQ (GH-20658) (GH-20737)
https://github.com/python/cpython/commit/b155381314c632e7dd452fbade3903e58657cfc7
History
Date User Action Args
2020-06-08 18:53:51brett.cannonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-06-08 18:53:40brett.cannonsetmessages: + msg371039
2020-06-08 18:53:32brett.cannonsetmessages: + msg371038
2020-06-08 18:08:12miss-islingtonsetpull_requests: + pull_request19945
2020-06-08 18:08:05miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request19944
2020-06-08 18:07:32brett.cannonsetmessages: + msg371034
2020-06-05 19:25:33brett.cannonsetassignee: docs@python -> brett.cannon
versions: + Python 3.10, - Python 3.6
2020-06-05 19:24:57brett.cannonsetkeywords: + patch
nosy: + brett.cannon

pull_requests: + pull_request19877
stage: needs patch -> patch review
2020-06-05 18:39:31brett.cannonsetnosy: - brett.cannon
2015-08-29 05:08:02terry.reedysetnosy: + terry.reedy
2015-08-23 06:52:07Paddy McCarthysetmessages: + msg249001
2015-08-23 01:45:49brett.cannonsetversions: + Python 3.6
nosy: + brett.cannon

messages: + msg248999

stage: needs patch
2015-08-22 06:45:10Paddy McCarthycreate