[issue27671] FAQ: len() is still function for good reason.
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
New submission from INADA Naoki: https://docs.python.org/3/faq/design.html#why-does-python-use-methods-for-so...
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... ---------- assignee: docs@python components: Documentation messages: 271881 nosy: docs@python, methane priority: normal severity: normal status: open title: FAQ: len() is still function for good reason. _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Terry J. Reedy added the comment: I agree. We do not need to semi-apologize for having generic functions be builtin generic functions. ---------- nosy: +terry.reedy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
INADA Naoki added the comment: I can't write long English document. Can I quote Guido's mail instead? ---------- keywords: +patch Added file: http://bugs.python.org/file46041/faq-function-method.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Changes by STINNER Victor <victor.stinner@gmail.com>: ---------- nosy: +haypo _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by INADA Naoki <songofacandy@gmail.com>: ---------- pull_requests: +7957 stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
INADA Naoki <songofacandy@gmail.com> added the comment: 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/c48e26dcadbff8620bb5881d3bd148fc889... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +8085 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +8086 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +8087 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/a621f406402e05febb302cf31962e9d2d74... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/0b376eb0d63e0c51ed55c620b40edae6ded... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: 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/dc9039da239ee572eaaf56e4a026be1fc4d... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Change by INADA Naoki <songofacandy@gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27671> _______________________________________
participants (4)
-
INADA Naoki
-
miss-islington
-
STINNER Victor
-
Terry J. Reedy