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: Add 'Integer' as synonym for 'Integral' in numbers module.
Type: enhancement Stage: resolved
Components: Versions: Python 3.8
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: JelleZijlstra, Sergey.Kirpichev, gvanrossum, mark.dickinson, ned.deily, rhettinger, serhiy.storchaka, terry.reedy, tim.peters
Priority: normal Keywords: patch

Created on 2018-02-21 05:34 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 25552 closed Sergey.Kirpichev, 2021-04-23 04:39
Messages (16)
msg312463 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-02-21 05:34
Actually, 'replace' 'Integral' with 'Integer' but keep 'Integral' for back compatibility.

From python-ideas, where Guido said "Looking at https://en.wikipedia.org/wiki/Number it seems that Integer is "special" -- every other number type is listed as "<adjective> numbers" (e.g. rational numbers, complex numbers) but integers are listed as "Integers". So let's just switch it to that, and keep Integral as an alias for backwards compatibility. I don't think it's a huge problem to fix this in 3.7b2, if someone wants to do the work."

PR needs What's New entry.

Ned, if you disagree as RM, please say so.
msg312473 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-02-21 06:45
Pickles containing a reference to Integer and created in new versions will be not compatible with older versions.
msg312481 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2018-02-21 09:14
+1 for the Integer alias, if it can be made to work. The "Integral" name has always felt clunky and non-obvious to me.
msg312494 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2018-02-21 13:19
And it's Ned's call, of course, but this smells like a new feature rather than a fix to me, and I'm not sure why it would be considered special enough to break the usual release-process rules. Serhiy's point about pickles shows that there's at least a little bit of care and thought needed here.
msg312530 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-02-22 03:54
As things stand, given Serhiy comment, I agree.

Like others, I don't like 'Integral', but also I don't like clunky special case code.
msg391681 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2021-04-23 11:51
For the record, here's the python-ideas thread: https://mail.python.org/archives/list/python-ideas@python.org/thread/AWNTQZ3HHAQ42O2ZHRA3U2US4HGKC2TF/

I'm no longer convinced that this is a good idea. It's the usual difference between "Would it have been better if we'd called it 'Integer' rather than 'Integral'?", and "Given where we are, is it worth changing the name now?". The name "Integral" isn't actually _wrong_ as such; it's just perhaps not the name that we would have chosen if we were inventing the numbers ABC right now.

If we add "Integer", we have to choose between

- maintaining both names indefinitely, or
- deprecating and eventually removing the "Integral" name

Neither option seems appealing: the first is a violation of "one obvious way"; the second causes unnecessary work for third-party projects already using Integral.
msg391685 - (view) Author: Sergey B Kirpichev (Sergey.Kirpichev) * Date: 2021-04-23 12:15
On Fri, Apr 23, 2021 at 11:51:17AM +0000, Mark Dickinson wrote:
> The name "Integral" isn't actually _wrong_ as such; it's just perhaps
> not the name that we would have chosen if we were inventing the
> numbers ABC right now.
> 
> If we add "Integer", we have to choose between
> 
> - maintaining both names indefinitely, or
> - deprecating and eventually removing the "Integral" name
> 
> Neither option seems appealing: the first is a violation of "one
> obvious way"; the second causes unnecessary work for third-party
> projects already using Integral.

The second option require very small part of work (oneline patch, to be
precise).  The one of the best parts of the Python is that it's a live
language.  I.e. wrong decisions could be corrected.

The current one is not wrong, in a strict sense, but if the C
standard, wikipedia pages, etc (include the Scheme numbers tower)
reference integer types and CPython docs call this "integral" -
I'm not sure if the later is a good name.
msg391953 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2021-04-26 17:21
Sorry, Sergey: I don't have the time, energy or inclination for an extended discussion here, so I'll simply record my -1 for the proposed change and move on. If you want to push this change through, the way forward would likely be to find a core developer (maybe Terry?) who's willing to champion the change (and review the PR, of course).
msg392016 - (view) Author: Sergey B Kirpichev (Sergey.Kirpichev) * Date: 2021-04-27 02:18
> so I'll simply record my -1 for the proposed change and move on

Mark, thank you for some PR review, anyway.  I hope, we still can count Guido +1 on the change.

> If you want to push this change through, the way forward would likely be to find a core developer (maybe Terry?) who's willing to champion the change (and review the PR, of course).

I'll try.  I've asked Terry for review.

For the record, I've tried to find why it was decided to live with Integral class, instead of Integer.  Unfortunately, it seems there was no public discussion on this.

This one with Integer:
https://mail.python.org/pipermail/python-3000/2007-May/007711.html
and this without:
https://mail.python.org/pipermail/python-3000/2007-August/009068.html
msg392017 - (view) Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) Date: 2021-04-27 02:49
Like Mark I'm opposed to this change. It requires little work in CPython itself, but numbers.Integral has now been a part of the language for many years and the name is used in numerous third-party projects. Forcing all of them to change doesn't seem particularly valuable. "Integer" is probably a better name in a vacuum, but "Integral" isn't actively misleading.
msg392019 - (view) Author: Sergey B Kirpichev (Sergey.Kirpichev) * Date: 2021-04-27 03:36
On Tue, Apr 27, 2021 at 02:49:15AM +0000, Jelle Zijlstra wrote:
> Forcing all of them to change doesn't seem particularly valuable.

It seems, this will cost very little work on their side, much
less than on the CPython side.  Do you agree?

Something like this change:
https://docs.python.org/3.7/whatsnew/3.7.html#id3
- require much more efforts...

> but "Integral" isn't actively misleading.

Well, sometimes it surprise people, e.g.:
https://mail.python.org/archives/list/python-ideas@python.org/message/2KQSRVBUWGBVV2MPTI4J6M4BVO2NYB3V/

BTW, we already have some inconsistencies around this
terminology.  E.g. recently introduced Decimal.is_integer() vs to_integral():
https://bugs.python.org/issue26680#msg262715
msg392020 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-04-27 03:44
I concur with Serhiy, Mark and Jelle for the reasons they listed.   Am marking this as closed.  If there were a greenfield exercise, Integer would be a mildly better choice.  However, this code has long been deployed and changing it would create more disruption than benefit.

Thank you for the suggestion but it doesn't make sense for us.
msg392023 - (view) Author: Sergey B Kirpichev (Sergey.Kirpichev) * Date: 2021-04-27 04:05
> Thank you for the suggestion

Raymond, that was Guido's suggestion.
msg392043 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2021-04-27 08:31
> that was Guido's suggestion.

Well, that complicated things ;-)  I suppose he can revive this if he wants.  Perhaps after seeing how pervasive the change is he will be less inclined.  Jelle, Mark, and I have all thought about it and don't think it is worth the disruption. In 14 years we hadn't had user reports or any other evidence that word Integral is problematic, so it isn't that there is any problem to be solved.
msg392588 - (view) Author: Sergey B Kirpichev (Sergey.Kirpichev) * Date: 2021-05-01 11:46
On Tue, Apr 27, 2021 at 08:31:35AM +0000, Raymond Hettinger wrote:
> Well, that complicated things ;-)  I suppose he can revive this if he wants.

That was just to note: it wasn't my (=> bad & stupid) idea.  Lets hope, he will
note, even not being subscribed :-)

> Perhaps after seeing how pervasive the change is he will be less inclined.

Even CPython patch is small.  Downstream changes are one-line patches,
much smaller than usual CPython compatibility breaks.  Just to note.

> Jelle, Mark, and I have all thought about it and don't think it is worth the disruption.

Agaist Guido and Terry.  (I don't count Serhiy on your side.)

> In 14 years we hadn't had user reports or any other evidence that word Integral is problematic, so it isn't that there is any problem to be solved.

It's not too problematic, but can surprise users.  Not just me - see
example with Nick in the thread.
msg392592 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-05-01 12:50
Guido, Integer as synonym for Integral was your idea, or at least your endorsement prompted me to file the issue.  Other core devs don't think the change is worth the trouble; I don't much care.  Speak up if you want to revive it.
History
Date User Action Args
2022-04-11 14:58:58adminsetgithub: 77072
2021-05-01 12:50:55terry.reedysetnosy: + gvanrossum
messages: + msg392592
2021-05-01 11:46:45Sergey.Kirpichevsetmessages: + msg392588
2021-04-27 08:31:35rhettingersetmessages: + msg392043
2021-04-27 04:05:23Sergey.Kirpichevsetmessages: + msg392023
2021-04-27 03:44:38rhettingersetstatus: open -> closed
resolution: rejected
messages: + msg392020

stage: patch review -> resolved
2021-04-27 03:36:56Sergey.Kirpichevsetmessages: + msg392019
2021-04-27 02:49:15JelleZijlstrasetnosy: + JelleZijlstra
messages: + msg392017
2021-04-27 02:18:49Sergey.Kirpichevsetmessages: + msg392016
2021-04-26 17:21:03mark.dickinsonsetmessages: + msg391953
2021-04-23 12:15:39Sergey.Kirpichevsetmessages: + msg391685
2021-04-23 11:51:17mark.dickinsonsetnosy: + tim.peters, rhettinger
messages: + msg391681
2021-04-23 04:39:01Sergey.Kirpichevsetkeywords: + patch
stage: test needed -> patch review
pull_requests: + pull_request24272
2021-04-14 04:29:37Sergey.Kirpichevsetnosy: + Sergey.Kirpichev
2018-02-22 03:54:48terry.reedysetpriority: high -> normal

messages: + msg312530
versions: - Python 3.7
2018-02-21 13:19:59mark.dickinsonsetmessages: + msg312494
2018-02-21 09:14:48mark.dickinsonsetnosy: + mark.dickinson
messages: + msg312481
2018-02-21 06:45:10serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg312473
2018-02-21 05:34:52terry.reedycreate