Issue 27671: FAQ: len() is still function for good reason. (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/71858

classification

Title: FAQ: len() is still function for good reason.
Type: Stage: resolved
Components: Documentation Versions:

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, methane, miss-islington, terry.reedy, vstinner
Priority: normal Keywords: patch

Created on 2016-08-03 09:01 by methane, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
faq-function-method.patch methane,2016-12-26 12:00 review
Pull Requests
URL Status Linked Edit
PR 8432 merged methane,2018-07-24 06:21
PR 8577 merged miss-islington,2018-07-31 05:49
PR 8578 merged miss-islington,2018-07-31 05:50
PR 8579 merged miss-islington,2018-07-31 05:51
Messages (7)
msg271881 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-08-03 09:01
https://docs.python.org/3/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list > The major reason is history. ... > but it’s a part of Python, and it’s too late to make such fundamental changes now. The functions have to remain to avoid massive code breakage. People seeing this answer may think "it's bad design, but remains for historical reason." But there is more positive reason why len is still function. http://effbot.org/pyfaq/why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list.htm
msg272051 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2016-08-05 18:53
I agree. We do not need to semi-apologize for having generic functions be builtin generic functions.
msg284023 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-12-26 12:00
I can't write long English document. Can I quote Guido's mail instead?
msg322721 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2018-07-31 05:49
New changeset c48e26dcadbff8620bb5881d3bd148fc8894d0ef by INADA Naoki in branch 'master': bpo-27671: Update FAQ about why len is function (GH-8432) https://github.com/python/cpython/commit/c48e26dcadbff8620bb5881d3bd148fc8894d0ef
msg322723 - (view) Author: miss-islington (miss-islington) Date: 2018-07-31 05:54
New changeset a621f406402e05febb302cf31962e9d2d747d8f6 by Miss Islington (bot) in branch '3.7': bpo-27671: Update FAQ about why len is function (GH-8432) https://github.com/python/cpython/commit/a621f406402e05febb302cf31962e9d2d747d8f6
msg322724 - (view) Author: miss-islington (miss-islington) Date: 2018-07-31 05:56
New changeset 0b376eb0d63e0c51ed55c620b40edae6ded4ea48 by Miss Islington (bot) in branch '3.6': bpo-27671: Update FAQ about why len is function (GH-8432) https://github.com/python/cpython/commit/0b376eb0d63e0c51ed55c620b40edae6ded4ea48
msg322725 - (view) Author: miss-islington (miss-islington) Date: 2018-07-31 05:58
New changeset dc9039da239ee572eaaf56e4a026be1fc4d74e24 by Miss Islington (bot) in branch '2.7': bpo-27671: Update FAQ about why len is function (GH-8432) https://github.com/python/cpython/commit/dc9039da239ee572eaaf56e4a026be1fc4d74e24
History
Date User Action Args
2022-04-11 14:58:34 admin set github: 71858
2018-07-31 07:37:40 methane set status: open -> closedresolution: fixedstage: patch review -> resolved
2018-07-31 05:58:14 miss-islington set messages: +
2018-07-31 05:56:29 miss-islington set messages: +
2018-07-31 05:54:27 miss-islington set nosy: + miss-islingtonmessages: +
2018-07-31 05:51:33 miss-islington set pull_requests: + <pull%5Frequest8087>
2018-07-31 05:50:33 miss-islington set pull_requests: + <pull%5Frequest8086>
2018-07-31 05:49:40 miss-islington set pull_requests: + <pull%5Frequest8085>
2018-07-31 05:49:26 methane set messages: +
2018-07-24 06:21:52 methane set stage: patch reviewpull_requests: + <pull%5Frequest7957>
2017-01-03 14:35:54 vstinner set nosy: + vstinner
2016-12-26 12:00:29 methane set files: + faq-function-method.patchkeywords: + patchmessages: +
2016-08-05 18:53:42 terry.reedy set nosy: + terry.reedymessages: +
2016-08-03 09:01:26 methane create