This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Remove invalid number from squares in introduction section
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: docs@python, ezio.melotti, loewis, mark.dickinson, nullishzero, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2014-02-23 07:10 by nullishzero, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_squares.patch nullishzero, 2014-02-23 07:10 review
Messages (7)
msg211982 - (view) Author: Pavel Kazakov (nullishzero) * Date: 2014-02-23 07:10
This is probably being nitpicky, but in the introduction section, the squares list include a 2:
squares = [1, 2, 4, 9, 16, 25]

However, 2 is not a square number (perfect square). So it should be:
[1, 4, 9, 16, 25]

I've included a patch that removes the 2.
msg212127 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2014-02-24 18:08
That's not nitpicky!  It's a potentially confusing error that should definitely be rectified.

(Alternatively, we could redefine squares in Python.  All other languages just have the regular squares;  Python has a super *extra* square 2!  That clearly makes squares in Python *better* than squares in other languages...)
msg212128 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2014-02-24 18:50
We should then declare that π is a square, which would allow an easy solution to squaring a circle in Python ☺
msg212129 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-02-24 18:53
> Python has a super *extra* square 2!

And let's not forget about -1.
msg212130 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-02-24 18:59
New changeset 151a498c55e3 by Ezio Melotti in branch '3.3':
#20740: desquarify 2.
http://hg.python.org/cpython/rev/151a498c55e3

New changeset 1bc585ba5df2 by Ezio Melotti in branch 'default':
#20740: merge with 3.3.
http://hg.python.org/cpython/rev/1bc585ba5df2
msg212131 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2014-02-24 19:01
Fixed, thanks for the report and the patch!
msg212242 - (view) Author: Pavel Kazakov (nullishzero) * Date: 2014-02-26 06:20
> (Alternatively, we could redefine squares in Python.  All other languages just have the regular squares;  Python has a super *extra* square 2!  That clearly makes squares in Python *better* than squares in other languages...)

Heh. I initially wasn't sure if I was just missing a super fancy feauture of Python, but I eventually concluded the 2 probably wasn't supposed to be there.

In the name of making Python better, since π and -1 have already been proposed as additional squares, I vote for including the constant e as well.

> Fixed, thanks for the report and the patch!

Great! Thanks.
History
Date User Action Args
2022-04-11 14:57:59adminsetgithub: 64939
2014-02-26 06:20:06nullishzerosetmessages: + msg212242
2014-02-24 19:01:42ezio.melottisetstatus: open -> closed
versions: + Python 3.3, Python 3.4
messages: + msg212131

resolution: fixed
stage: resolved
2014-02-24 19:00:00python-devsetnosy: + python-dev
messages: + msg212130
2014-02-24 18:53:44pitrousetnosy: + pitrou
messages: + msg212129
2014-02-24 18:50:17loewissetnosy: + loewis
messages: + msg212128
2014-02-24 18:08:59mark.dickinsonsetnosy: + mark.dickinson
messages: + msg212127
2014-02-23 07:26:12georg.brandlsetassignee: docs@python -> ezio.melotti

nosy: + ezio.melotti
2014-02-23 07:10:54nullishzerocreate